Skip to content
This repository was archived by the owner on Mar 31, 2022. It is now read-only.
This repository was 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

@dschulten

Description

@dschulten

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions