Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Logger injection error during install when running with Maven < 3.5.x #252

Closed
dschulten opened this issue Nov 21, 2018 · 16 comments
Closed
Labels

Comments

@dschulten
Copy link

dschulten commented Nov 21, 2018

Is this a BUG REPORT or FEATURE REQUEST?: Bug report

Description

When running mvn install with the plugin on Maven 3.3.9 (the default version embedded with Intellij 2018.2), the following injection error occurs and causes the build to fail.

java.lang.IllegalArgumentException: Can not set org.eclipse.aether.spi.log.Logger field org.apache.maven.repository.internal.DefaultVersionResolver.logger to org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory

With Maven 3.5.4 the error disappears.

Similar problem here, with full stacktrace: jeremylong/DependencyCheck#1054

How to reproduce

Use the plugin with Maven 3.3.9 using the plugin configuration below and run mvn install.

<plugin>
    <groupId>com.spotify</groupId>
    <artifactId>dockerfile-maven-plugin</artifactId>
    <version>1.4.8</version>
    <executions>
        <execution>
            <id>deploy-image</id>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <!-- must not contain uppercase letters or docker refuses connection! -->
        <repository>foo/bar-app</repository>
        <buildArgs>
            <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
        </buildArgs>
    </configuration>
</plugin>

What do you expect

Build should succeed

What happened instead

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:10 min
[INFO] Finished at: 2018-11-21T15:05:46+01:00
[INFO] Final Memory: 52M/393M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (default-install) on project gateway: Execution default-install of goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install failed: Unable to load the mojo 'install' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-install-plugin:2.5.2': com.google.inject.ProvisionException: Unable to provision, see the following errors:
...
[ERROR] 4 errors

Software:

  • Output of docker version:

Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:34 2018
OS/Arch: windows/amd64
Experimental: false

Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:29:02 2018
OS/Arch: linux/amd64
Experimental: false

  • Spotify's dockerfile-maven version: 1.4.8

Full backtrace

Four long stacktraces show that a logger could not be injected four times, too long to paste here

@stale
Copy link

stale bot commented Jan 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 28, 2019
@tychobrailleur
Copy link

I was getting the issue with version 1.4.10 of the plugin, but reverting to version 1.4.1 fixed it.

@stale stale bot removed the stale label Jan 28, 2019
@emichalsky
Copy link

We got the same issue with IntelliJ 2018.3.4. Last plugin version that works is 1.4.6 , all later versions produce the same error.

@sseide
Copy link

sseide commented Feb 8, 2019

We ran into the same issue after trying to update the maven plugin version. We are not able to use maven inside latest Intellij 2018.3 with all plugin versions since 1.4.7. Need to downgrade to 1.4.6.

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /opt/intellij-2018.3/plugins/maven/lib/maven3
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre

@mattnworb
Copy link
Member

I found a bit more on this issue in https://stackoverflow.com/questions/47920305/can-not-set-org-eclipse-aether-spi-log-logger-with-custom-maven-plugin

It seems like a general issue with Maven plugins, not something unique to dockerfile-maven-plugin.

I think the specific commit in this repo where this started is 6744acf where we upgraded the maven-core and other dependencies to be able to support Java 11.

@hauntingEcho
Copy link

I'm seeing this issue as well, using maven 3.3.9 and dockerfile-maven-plugin 1.4.10. Please mark the required maven version in the POM

@antoinetran
Copy link

antoinetran commented Apr 4, 2019

Reproduced the error, with Maven embedded in Eclipse (3.3.3). The error occurred when trying to push, but I got no error when building the image.
I agree about the maven enforcer plugin said by @hauntingEcho, and please also put in documentation that dockerfile-maven-plugin <=1.4.6 needs Maven 3.X, and for other case Maven >= 3.5.2.

@oaj
Copy link

oaj commented May 21, 2019

I ended up here having the same error. It used to work before when I used oracle java - now I use open JDK

@oaj
Copy link

oaj commented May 21, 2019

Apache Maven 3.6.0
Java version: 1.8.0_212, vendor: Oracle Corporation
1.4.10

, this works now. I just changed back to Oracle java.

With openjdk version "1.8.0_212" I get the error.

@stale
Copy link

stale bot commented Jul 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 20, 2019
@hauntingEcho
Copy link

bumping to save the issue from stalebot

@stale
Copy link

stale bot commented Sep 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 18, 2019
@antoinetran
Copy link

Up. There is no reason why a change of documentation should be difficult, I can do a PR if the author wants. The only change I ask is to clarify the Maven version prerequisite.

@stale stale bot removed the stale label Sep 18, 2019
@mattnworb
Copy link
Member

@antoinetran a PR is definitely welcome

@antoinetran
Copy link

Done! #318

@stale
Copy link

stale bot commented Nov 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 18, 2019
@stale stale bot closed this as completed Nov 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants