Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.3
-
Fix Version/s: None
-
Labels:None
Description
I have one structure that defines 3 projects:
project1-jar
project2-war
project3-ear
project2-war is just a WAR that contains the project1-jar as a library (WEB-INF/lib)
project3-ear is an EAR that contains project2-war as its only web module.
When I run mvn package it works perfectly and creates the EAR containing the proper WAR file and the application.xml, so it works fine, but when I run mvn eclipse:eclipse to generate the projects, the ear project is not generated properly as it tries to find the war in the local and remote repository as the piece of logging show bellow:
[INFO] Building project3-ear
[INFO] task-segment: [eclipse:eclipse]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
Downloading: http://mycompany.central-repository/repo/com/mycompany/project2-war/1.0-SNAPSHOT/project2-war-1.0-SNAPSHOT.war
[WARNING] Unable to get resource 'mycompanygroupid:project2-war:war:1.0-SNAPSHOT' from repository mycompany.central-repository (http://mycompany.central-repository/repo)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) mycompanygroupid:project2-war:war:1.0-SNAPSHOT
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=mycompanygroupid -DartifactId=project2-war \
-Dversion=1.0-SNAPSHOT -Dpackaging=war -Dfile=/path/to/file
Path to dependency:
1) mycompanygroupid:project3-ear:ear:1.0-SNAPSHOT
2) mycompanygroupid:project2-war:war:1.0-SNAPSHOT
----------
1 required artifact is missing.
for artifact:
mycompanygroupid:project3-ear:ear:1.0-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
mycompany.central-repository (http://mycompany.central-repository/repo)
If I follow this instructions and install my WAR file to my local repository, it then works and makes my EAR project, but I believe it shouldn't be necessary.
Issue Links
- is related to
-
MECLIPSE-37
eclipse:eclipse should execute in a later phase than "generate-sources"
-
- relates to
-
MEAR-107
Cannot generate Eclipse file with eclipse:eclipse when dependent projects are not installed in repository
-
The problem seems to be caused by the eclipse plugin executing the generate-resources lifecycle phase, which in turn cause the ear plugin to perform dependency resolution.