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

After upgrading jib-maven-plugin from 3.0.0 to 3.1.0 entrypoint=INHERIT doesn't ignore mainClass #3295

Closed
estambakio-sc opened this issue Jun 10, 2021 · 2 comments · Fixed by #3296
Assignees
Milestone

Comments

@estambakio-sc
Copy link

estambakio-sc commented Jun 10, 2021

Environment:

  • Jib version: 3.1.0 (jib-maven-plugin)
  • Build tool: Maven 3.6.3
  • OS: Linux

Description of the issue:

After updating jib-maven-plugin from version 3.0.0 to version 3.1.0 execution of dockerBuild goal for container with container.entrypoint=INHERIT configuration option fails with error:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.1.0:dockerBuild (docker-image-package) on project javadocs: Main class was not found, perhaps you should add a `mainClass` configuration to jib-maven-plugin -> [Help 1]

README says that entrypoint=INHERIT means mainClass is not taken into account, which seems to be broken in 3.1.0

Expected behavior:

After updating 3.0.0 -> 3.1.0 build should succeed because release notes don't say anything about changed behaviour of entrypoint=INHERIT configuration.

Steps to reproduce:

  1. Add jib-maven-plugin configuration from block below with version 3.0.0 into pom.xml:

  2. Execute the following command: mvn package and Docker image is built successfully.

  3. Change jib-maven-plugin version to 3.1.0, execute mvn package - build fails with the following error:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.1.0:dockerBuild (docker-image-package) on project javadocs: Main class was not found, perhaps you should add a `mainClass` configuration to jib-maven-plugin -> [Help 1]

jib-maven-plugin Configuration:

<build>
    <plugins>
      <plugin>
          <groupId>com.google.cloud.tools</groupId>
          <artifactId>jib-maven-plugin</artifactId>
          <version>3.0.0</version> <!-- 3.0.0 works, 3.1.0 fails -->
          <configuration>
            <from>
              <image>nginx:alpine</image>
            </from>
            <to>
              <image>a:b</image>
            </to>
            <container>
              <entrypoint>INHERIT</entrypoint>
            </container>
          </configuration>
          <executions>
            <execution>
              <id>docker-image-package</id>
              <phase>package</phase>
              <goals>
                <goal>dockerBuild</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
    </plugins>
</build>

Log output:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.1.0:dockerBuild (docker-image-package) on project javadocs: Main class was not found, perhaps you should add a `mainClass` configuration to jib-maven-plugin -> [Help 1]

Additional Information:

@chanseokoh
Copy link
Member

Will fix this and make a patch release.

@chanseokoh
Copy link
Member

@estambakio-sc @dkuzmianok-sc just released Jib 3.1.1 with the fix.

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

Successfully merging a pull request may close this issue.

3 participants