Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strictly name the org.json module for JLink and JPackage #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
**/*.idea
src/main
*.iml
5 changes: 5 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#!/bin/bash
SRC_FOLDER=dist/src/main/java/org/json
MODITECT_FOLDER=dist/src/moditect
WORKING_DIR=`pwd`

# Get the original sources from Douglas Crockfords GitHub repo
mkdir -p $SRC_FOLDER
#mkdir -p $MODITECT_FOLDER
# Copy the module-info to the dist folder to build
#cp src/moditect/module-info.java $MODITECT_FOLDER/module-info.java
#echo "Copied the module info file"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about these 4 lines? Are they neccessary, not neccessary or optional? Or are there conditions when they should be enabled?

git clone https://github.com/stleary/JSON-java.git $SRC_FOLDER

echo ""
Expand Down
95 changes: 82 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,19 @@
</dependency>
</dependencies>

<build>
<!-- Allow finding fixed moditect version -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please extend this comment in a way that it somehow says when the snapshot repository can be removed again? Something like: "Remove this when we have an official moditect release containing bugfix X". Or "Remove this when modditect version x is released"?

<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>


<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
Expand All @@ -113,14 +125,45 @@
</instructions>
</configuration>
</plugin>
<!-- Force Maven to run under 1.8, The compiler is set to 1.6, and 1.7 to build the output -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>1.8.0</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.1</version>
<configuration>
<source>%%JAVAVERSION%%</source>
<target>%%JAVAVERSION%%</target>
<!--<source>1.6</source>
<target>1.6</target>-->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, target is now defined twice

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, no, sorry, it's a block comment...

Could you remove the commented out code here?

<!--<release>1.11</release>-->
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>7.0</version>
</dependency>
</dependencies>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment to the pom why this new dependency is needed here?

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -147,10 +190,22 @@
</goals>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<failOnError>false</failOnError>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand All @@ -165,17 +220,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand All @@ -187,6 +231,31 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Beta2</version>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<!-- Put module-info.class in META-INF/versions/9 to maximize backwards compat -->
<!-- See: https://github.com/moditect/moditect/issues/67 -->
<jvmVersion>9</jvmVersion>
Copy link
Owner

@BGehrels BGehrels Sep 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this automatically be available for Java 10, 11 and 12 then?

<overwriteExistingFiles>true</overwriteExistingFiles>
<module>
<moduleInfoFile>
src/moditect/module-info.java
</moduleInfoFile>
</module>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions src/moditect/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module org.json {
exports org.json;
}