mojohaus / mojohaus/exec-maven-plugin

exec-maven-plugin ignores my company-local repository from settings.xml

Open
#67 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
191
Forks
111
Avg merge
1d 21h
Merged PRs (30d)
4

Description

In my company we're using an artifactory which everybody has configured as a repository in their own ~.m2\repository\settings.xml file (and this works).

But for some reason the exec-maven-plugin ignores / dislikes this repository. In my exec plugin configuration I've got a dependency that is in the mentioned repository:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.3.2</version>
        <executions>
            ...
        </executions>
        <dependencies>
            <dependency>
                <groupId>com.sencha.gxt</groupId>
                <artifactId>gxt-themebuilder</artifactId>
                <version>3.1.4</version>
            </dependency>
        </dependencies>
    </plugin>

and when I run the build, maven correctly resolves the dependency from the company repository but the exec plugin fails after trying to get the dependency from the global maven repositories (but not from the company repository):

» mvn clean install                                                                                                                                     
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] ------------------------------------------------------------------------
Downloading: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-themebuilder/3.1.4/gxt-themebuilder-3.1.4.pom
Downloaded: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-themebuilder/3.1.4/gxt-themebuilder-3.1.4.pom (11 KB at 11.4 KB/sec)
Downloading: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-parent/3.1.4/gxt-parent-3.1.4.pom
Downloaded: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-parent/3.1.4/gxt-parent-3.1.4.pom (15 KB at 45.1 KB/sec)
Downloading: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.pom
Downloaded: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.pom (7 KB at 29.6 KB/sec)
Downloading: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-themebuilder/3.1.4/gxt-themebuilder-3.1.4.jar
Downloading: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.jar
Downloaded: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt-themebuilder/3.1.4/gxt-themebuilder-3.1.4.jar (1719 KB at 766.7 KB/sec)
Downloaded: http://maven.my-company-artifactory.nil:8081/artifactory/sencha-commercial-release/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.jar (3706 KB at 852.4 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ my-project ---
[INFO] Deleting C:\workspace\MyProject\target
[INFO]
[INFO] --- maven-download-plugin:1.1.0:wget (download-phantomjs) @ my-project ---
[INFO] Got from cache: C:\Users\machner\.m2\repository\.cache\maven-download-plugin\phantomjs-1.9.6-windows.zip
[INFO]
[INFO] --- exec-maven-plugin:1.3.2:java (generate-my-project-gen) @ my-project ---
Downloading: http://repo.maven.apache.org/maven2/com/sencha/gxt/gxt-themebuilder/3.1.4/gxt-themebuilder-3.1.4.jar
Downloading: http://repo.maven.apache.org/maven2/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.jar
Downloading: https://oss.sonatype.org/content/repositories/google-snapshots/com/sencha/gxt/gxt/3.1.4/gxt-3.1.4.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.770s
[INFO] Finished at: Wed Oct 26 16:44:23 CEST 2016
[INFO] Final Memory: 11M/241M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java (generate-my-project-gen) on project my-project: Execution generate-my-project-gen of goal org.codehaus.mojo:exec-maven-plugin:1.3.2:java failed: Plugin org.codehaus.mojo:exec-maven-plugin:1.3.2 or one of its dependencies could not be resolved: The following artifacts could not be resolved: com.sencha.gxt:gxt-themebuilder:jar:3.1.4, com.sencha.gxt:gxt:jar:3.1.4: Could not find artifact com.sencha.gxt:gxt-themebuilder:jar:3.1.4 in central (http://repo.maven.apache.org/maven2) -> [Help 1]

When inside my local repository I delete the _remote.repositories files for my dependency as suggested here the build passes. So it appears as if the exec plugin for some reason 'disliked' the company repository.

Any help would be appreciated.
Thanks,
Piotr

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the shown exec-maven-plugin:java configuration and the company repository in settings.xml, comparing normal Maven resolution with the plugin's dependency resolution. Trace the plugin's repository handling and add or update a regression test if the repository-specific behavior is covered; done means the dependency resolves through the configured company repository without deleting _remote.repositories files.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.