-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Automatic-Module-Name manifest entry to Java jar files #2451
Comments
Do you have sample and maven documentation related to this field ? since the jar is generated by our pom.xml .... |
You can add it via the maven jar plugin: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.google.ortools</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin> |
Will postpone it after release since I need to change our pom.xml runtime template to add a new variable then adapt cmake and makefile to change it. DevNote add
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>@JAVA_PACKAGE@</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<Automatic-Module-Name>@JAVA_PACKAGE@.@JAVA_PLATFORM_OS@</Automatic-Module-Name> rework: Lines 44 to 52 in 86d4c54
to introduce JAVA_PLATFORM_OS and JAVA_PLATFORM_ARCH so NATIVE_IDENTIFIER become
set(NATIVE_IDENTIFIER "${JAVA_PLATFORM_OS}-${JAVA_PLATFORM_ARCH}") todo(mizux): Add
$(SED) -i -e 's;@JAVA_PLATFORM_OS@;$(JAVA_PLATFORM_OS);' \
$(TEMP_JAVA_DIR)$S$(JAVA_ORTOOLS_NATIVE_PROJECT)$Spom.xml see:
ref: http://java-native-access.github.io/jna/5.10.0/javadoc/com/sun/jna/Platform.html#RESOURCE_PREFIX |
What language and solver does this apply to?
Java
Describe the problem you are trying to solve.
The current Linux jar file cannot be used with the Java module system because it’s file name cannot be converted into an automatic module name. Adding this additional manifest entry will fix this.
Describe the solution you'd like
Add
Automatic-Module-Name: com.google.ortools
to the
ortools-java-xxx.jar
fileAdd
Automatic-Module-Name: com.google.ortools.linux
to the
ortools-linux-xxx-xxxx.jar
file.Similar automatic module names should be added to the other os specific jar files (i.e .windows, .mac)
The text was updated successfully, but these errors were encountered: