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

chore: add Automatic-Module-Name #13

Closed
wants to merge 1 commit into from

Conversation

@florian-beetz
Copy link

commented May 24, 2018

Add Automatic-Module-Name entry to the MANIFEST.MF
Value is org.postgresql.jdbc

pgjdbc/pgjdbc#1031

Add Automatic-Module-Name entry to the MANIFEST.MF
Value is `org.postgresql.jdbc`

pgjdbc/pgjdbc#1031
@florian-beetz

This comment has been minimized.

Copy link
Author

commented May 24, 2018

This PR adds @AlexElin's changes of pgjdbc/pgjdbc#1059 to pgjdbc-parent-pom as suggested by @vlsi .

@florian-beetz florian-beetz referenced this pull request May 24, 2018
0 of 6 tasks complete
@davecramer

This comment has been minimized.

Copy link
Member

commented May 25, 2018

Is there any way to test this ?

@florian-beetz

This comment has been minimized.

Copy link
Author

commented May 25, 2018

@davecramer Yes, I tested this by adjusting the parent version of https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/pom.xml#L6 to 1.1.4-SNAPSHOT and running

mvn install -f pgjdbc-parent-poms/pom.xml
mvn package -f pgjdbc/pom.xml -DskipTests=true
unzip -p pgjdbc/pgjdbc/target/postgresql-42.2.3-SNAPSHOT.jar META-INF/MANIFEST.MF | grep Automatic-Module-Name
@cowwoc

This comment has been minimized.

Copy link

commented Jul 30, 2019

@davecramer Can this be merged?

@davecramer

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

So I've just tested this and from what I can tell we have to use a JDK > 1.8 to build it to make this happen, it's somewhat easier to add it to pgjdbc/pom.xml

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                  <archive>
                    <manifestEntries>
                      <Automatic-Module-Name>org.postgresql.jdbc</Automatic-Module-Name>
                    </manifestEntries>
                  </archive>
              </configuration>
      </plugin>
@cowwoc

This comment has been minimized.

Copy link

commented Jul 31, 2019

@davecramer I'm not sure I understand why you'd need a JDK > 1.8 to build it. The code snippet you shared will run on older JDKs.

I must have misunderstood what you meant somehow :)

@davecramer

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

@cowwoc When I tried this using jdk8 the Automatic-Module-Name was not in the manifest. When I switched to JDK10 it was. I'd love to be proven wrong.

@cowwoc

This comment has been minimized.

Copy link

commented Jul 31, 2019

@davecramer This seems to work for me under JDK 8. I ran mvn install on the attached testcase and as you can see the generated JAR file has the Automatic-Module-Name attribute in the manifest file.

automatic-module-name-jdk8.zip

@davecramer

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

Seems to work fine in travis using maven as well. I have no idea what I did wrong. I prefer it in maven

@davecramer

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

@davecramer davecramer closed this Jul 31, 2019
@cowwoc

This comment has been minimized.

Copy link

commented Jul 31, 2019

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.