Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Automatic-Module-Name on fatjar to provide Java 9 module support. #95

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

ascopes
Copy link
Contributor

@ascopes ascopes commented Jan 5, 2022

This should provide the ability to use this package with Java 9 modules.

Currently, builds under Java 9 or newer that rely on modules will flag the following warning:

[INFO] --- maven-compiler-plugin:3.8.1:compile (java-compile) @ katana-compiler-testing ---
[WARNING] ********************************************************************************************************************************************
[WARNING] * Required filename-based automodules detected: [fuzzywuzzy-1.3.1.jar]. Please don't publish this project to a public artifact repository! *
[WARNING] ********************************************************************************************************************************************

Worth noting that the tests are not running for me:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running me.xdrop.diffutils.DiffUtilsTest
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.264 sec <<< FAILURE!
testGetRatio(me.xdrop.diffutils.DiffUtilsTest)  Time elapsed: 0.063 sec  <<< ERROR!
groovy.lang.MissingMethodException: No signature of method: java.util.Random.nextInt() is applicable for argument types: (java.lang.Integer) values: [200]
Possible solutions: getAt(java.lang.String)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
        at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at me.xdrop.diffutils.DiffUtilsTest.testGetRatio(DiffUtilsTest.groovy:32)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at junit.framework.TestSuite.runTest(TestSuite.java:252)
        at junit.framework.TestSuite.run(TestSuite.java:247)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Results :

Tests in error: 
  testGetRatio(me.xdrop.diffutils.DiffUtilsTest): No signature of method: java.util.Random.nextInt() is applicable for argument types: (java.lang.Integer) values: [200](..)

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0

...however this appears to be out of scope of this specific change, so I have left this as-is for now.

ascopes added a commit to ascopes/katana-old that referenced this pull request Jan 5, 2022
@xdrop
Copy link
Owner

xdrop commented Jan 5, 2022

Thanks! Will get this merged & published once I get a chance

@xdrop xdrop merged commit 36cda63 into xdrop:master Jan 11, 2022
@ascopes ascopes deleted the task/add-jigsaw-support branch January 16, 2022 15:14
ascopes added a commit to ascopes/katana-old that referenced this pull request Jan 16, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants