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

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

Open
lreading opened this issue Sep 12, 2019 · 1 comment
Open

Comments

@lreading
Copy link

lreading commented Sep 12, 2019

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.

@lreading lreading changed the title Docker Build Failing with javax.annotations not found Docker Build Failing with "package javax.annotation does not exist" Sep 12, 2019
@helterskelter01
Copy link

helterskelter01 commented Jan 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants