jib-maven-plugin fails if maven-war-plugin "warName" property is set
See original GitHub issueEnvironment:
- Jib version: 1.8.0, 1.7.0
- Build tool: Maven 3.6.3
- OS: Fedora / Windows
Description of the issue: Between 1.6.1 and 1.7.0, the behaviour of the jib-maven-plugin changed and no longer works if the WAR name is not according to the default (artifactID-version.war), but changed using the “warName” property of the maven-war-plugin.
Expected behavior: Upgrading the jib-plugin from 1.6.1 to 1.7.0 does not change the result of the build.
Steps to reproduce: I created a small repository that you can clone: https://github.com/padyx/jib-test-repository
Working configuration (initial repository state):
- Alter the pom.xml File in helloworld.ui.html.app.war and change the target image to a location you can push to.
- Execute the build as follows:
mvn -Djib.to.auth.username=xxxxx -Djib.to.auth.password=xxxxx -DskipTests -P docker clean package
(Success)
Error if upgrading:
- Change the jib-maven-plugin Version to 1.7.0 (or 1.8.0) in the helloworld/pom.xml File.
- Rerun the build with the command above.
jib-maven-plugin
Configuration:
<!-- From parent module (build / pluginManagement) -->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- From build in actual module-->
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>tomcat:9-jdk11</image>
</from>
<to>
<image>padyx/testimage</image>
</to>
</configuration>
</plugin>
Log output:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.7.0:build (default) on project helloworld.ui.html.app.war: Obtaining project build output files failed; make sure you have compiled your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean compile jib:build"?): /home/chakotay/eclipse-workspace/helloworld/helloworld.ui.html.app.war/target/org.eclipse.scout.apps.helloworld.ui.html.war -> [Help 1]
Additional information The configuration for the war name is: (helloworld.ui.html.app.war POM File)
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>uihtml</warName>
</configuration>
</plugin>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
@padyx 2.0.0 has been released with this fix!
Awesome, thank you! 😻 I tried this out locally by building 1.8.1-SNAPSHOT and I can confirm it works now.