swagger-api / swagger-api/swagger-codegen
3.0.0 Dockerfile fails to build
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Dockerfile fails to build image for 3.0.0 branch.
Swagger-codegen version
n/a
Swagger declaration file content or url
n/a
Command line used for generation
n/a
Steps to reproduce
$ docker build ./
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.17kB done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 transferring context: 310B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/openjdk:17-jdk-alpine
#3 DONE 0.1s
#4 [ 1/11] FROM docker.io/library/openjdk:17-jdk-alpine@sha256:4b6abae565492dbe9e7a894137c966a7485154238902f2f25e9dbd9784383d81
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 38.00kB 0.0s done
#5 DONE 0.0s
#6 [ 8/11] COPY ./modules/swagger-codegen /opt/swagger-codegen/modules/swagger-codegen
#6 CACHED
#7 [ 2/11] RUN set -x && apk update && apk upgrade && apk add --no-cache bash ca-certificates maven
#7 CACHED
#8 [ 5/11] COPY ./google_checkstyle.xml /opt/swagger-codegen
#8 CACHED
#9 [ 6/11] COPY ./modules/swagger-codegen-maven-plugin /opt/swagger-codegen/modules/swagger-codegen-maven-plugin
#9 CACHED
#10 [ 3/11] WORKDIR /opt/swagger-codegen
#10 CACHED
#11 [ 4/11] COPY ./LICENSE /opt/swagger-codegen
#11 CACHED
#12 [ 7/11] COPY ./modules/swagger-codegen-cli /opt/swagger-codegen/modules/swagger-codegen-cli
#12 CACHED
#13 [ 9/11] COPY ./pom.docker.xml /opt/swagger-codegen/pom.xml
#13 CACHED
#14 [10/11] RUN mvn -am -pl "modules/swagger-codegen-cli" package
#14 1.258 [INFO] Scanning for projects...
#14 1.482 Downloading from sonatype-releases: https://oss.sonatype.org/content/repositories/releases/org/sonatype/oss/oss-parent/5/oss-parent-5.pom
#14 1.857 Progress (1): 2.7/4.1 kB
Progress (1): 4.1 kB
# removed excessive logs ...
#14 4.164 Downloaded from central: https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar (38 kB at 905 kB/s)
#14 4.189 [ERROR] [ERROR] Some problems were encountered while processing the POMs:
#14 4.189 [ERROR] 'dependencies.dependency.version' for org.mockito:mockito-core:jar must be a valid version but is '${mockito-version}'. @ line 304, column 22
#14 4.190 @
#14 4.190 [ERROR] The build could not read 1 project -> [Help 1]
#14 4.191 [ERROR]
#14 4.191 [ERROR] The project io.swagger.codegen.v3:swagger-codegen:3.0.45-SNAPSHOT (/opt/swagger-codegen/modules/swagger-codegen/pom.xml) has 1 error
#14 4.191 [ERROR] 'dependencies.dependency.version' for org.mockito:mockito-core:jar must be a valid version but is '${mockito-version}'. @ line 304, column 22
#14 4.191 [ERROR]
#14 4.193 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
#14 4.193 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
#14 4.193 [ERROR]
#14 4.193 [ERROR] For more information about the errors and possible solutions, please read the following articles:
#14 4.194 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
#14 ERROR: process "/bin/sh -c mvn -am -pl \"modules/swagger-codegen-cli\" package" did not complete successfully: exit code: 1
------
> [10/11] RUN mvn -am -pl "modules/swagger-codegen-cli" package:
#14 4.190 [ERROR] The build could not read 1 project -> [Help 1]
#14 4.191 [ERROR]
#14 4.191 [ERROR] The project io.swagger.codegen.v3:swagger-codegen:3.0.45-SNAPSHOT (/opt/swagger-codegen/modules/swagger-codegen/pom.xml) has 1 error
#14 4.191 [ERROR] 'dependencies.dependency.version' for org.mockito:mockito-core:jar must be a valid version but is '${mockito-version}'. @ line 304, column 22
#14 4.191 [ERROR]
#14 4.193 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
#14 4.193 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
#14 4.193 [ERROR]
#14 4.193 [ERROR] For more information about the errors and possible solutions, please read the following articles:
#14 4.194 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
------
Dockerfile:25
--------------------
23 |
24 | # Pre-compile swagger-codegen-cli
25 | >>> RUN mvn -am -pl "modules/swagger-codegen-cli" package
26 |
27 | # This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
--------------------
ERROR: failed to solve: process "/bin/sh -c mvn -am -pl \"modules/swagger-codegen-cli\" package" did not complete successfully: exit code: 1
Related issues/PRs
None found.
Suggest a fix/enhancement
Add the mockito version to pom.docker.xml.
Found the following in the related files:
./pom.java11.xml: <mockito-version>5.2.0</mockito-version>
./pom.java8.xml: <mockito-version>5.2.0</mockito-version>
./pom.xml: <mockito-version>5.2.0</mockito-version>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Dockerfile line 25 and pom.docker.xml, then compare the mockito-version entries in pom.xml, pom.java8.xml, and pom.java11.xml. Run docker build ./ and verify that the Maven step completes without the unresolved ${mockito-version} error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100