yinlou / mltk

Machine Learning Tool Kit
BSD 3-Clause "New" or "Revised" License
136 stars 74 forks source link

"mvn clean package" doesn't work #21

Closed dfrankow closed 5 years ago

dfrankow commented 5 years ago

I'm trying to build on OS X 10.14.4.

I get this error:

1 error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.082 s
[INFO] Finished at: 2019-04-23T21:20:38-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (attach-javadocs) on project mltk: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in http://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
[ERROR] 
[ERROR] Command line was: /Library/Java/JavaVirtualMachines/openjdk-12.0.1.jdk/Contents/Home/bin/javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/Users/dan/work/mltk/target/apidocs' dir.
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Might just be docs?

yinlou commented 5 years ago

This is a known issue with open jdk (https://bugs.openjdk.java.net/browse/JDK-8212233). Looks like you are using openjdk instead of Oracle's java. You can either build the project using jdk 1.8 (instead of 12) or download from complied package from maven central repository: https://search.maven.org/search?q=a:mltk

dfrankow commented 5 years ago

Right you are!

I ended up having to do this I think:

brew install caskroom/version/java8
brew cask install homebrew/cask-versions/adoptopenjdk8
brew install gpg

I can get the jar, but I want to know how to build it, in case anything has to be fixed.

yinlou commented 5 years ago

glad to see everything works!

dfrankow commented 5 years ago

For my own records: mvn install actually still didn't work, but for a different reason.

gpg: no default secret key: No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.816 s
[INFO] Finished at: 2019-04-24T13:03:01-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project mltk: Exit code: 2 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

However, I was able to build the jars with mvn test.

The java world seems to have become somewhat fragile.

Anyway, thanks for your help.

dfrankow commented 5 years ago

It occurs to me that one way to be more precise about this is to have a Dockerfile that builds the jar. That would very definitely specify the actual dependencies needed and end up with a jar.

I'm not saying you have to do it, just thinking out loud.

yinlou commented 5 years ago

I can't repeat your problem. I'm using a clean docker image and build from scratch. gpg is not installed.

dfrankow commented 5 years ago

I appreciate you trying.

I am installing on OS X, so I didn't currently try on docker. Just post your Dockerfile here for reference, and don't worry about it unless I come back for more. :)