jenkinsci / juseppe

Jenkins Update Site Embedded for Plugin Publishing Easily
https://hub.docker.com/r/lanwen/juseppe/
Apache License 2.0
56 stars 20 forks source link

Docker Build Failing with "package javax.annotation does not exist" #51

Open lreading opened 5 years ago

lreading commented 5 years ago

After cloning the repo and running docker build -t juseppe:source ., the build fails with the following errors:

[INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for juseppe 1.1.2-SNAPSHOT: [INFO] [INFO] juseppe ............................................ SUCCESS [ 0.026 s] [INFO] juseppe-core ....................................... FAILURE [ 35.130 s] [INFO] juseppe-cli ........................................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 35.316 s [INFO] Finished at: 2019-09-12T15:40:55Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project juseppe-core: Compilation failure: Compilation failure: [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Developer.java:[4,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Developer.java:[7,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/UpdateSite.java:[6,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/UpdateSite.java:[9,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Plugin.java:[6,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Plugin.java:[9,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Signature.java:[6,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Signature.java:[10,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Dependency.java:[4,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Dependency.java:[7,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Release.java:[4,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Release.java:[7,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/ReleaseHistory.java:[6,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/ReleaseHistory.java:[9,2] cannot find symbol [ERROR] symbol: class Generated [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Day.java:[6,24] package javax.annotation does not exist [ERROR] /juseppe/juseppe-core/target/generated-sources/java-gen/ru/lanwen/jenkins/juseppe/beans/Day.java:[9,2] cannot find symbol [ERROR] symbol: class Generated [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/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :juseppe-core The command 'mvn package -Dmaven.test.skip=true' returned a non-zero code: 1

Running the same maven command mvn package -Dmaven.test.skip=true works as expected.

The Dockerfile is pulling from maven without a specific tag, which brings in latest by default.

Updating the Dockerfile to use FROM maven:3.6.2-jdk-8-slim resolves the docker build issue.

https://github.com/lreading/juseppe/commit/e9b067175cd1ece30c7a1b8ad4a40c08c9acb7f4

I can create a PR if you'd like.

helterskelter01 commented 8 months ago

I just had the same issue using the maven:latest base image. I added the following in juseppe-core/pom.xml file:

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

And that solved my issue. I was able to build.