maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte (JIRA)" <j...@codehaus.org>
Subject [jira] (MNG-5082) Regression: Could not resolve dependencies for project
Date Fri, 13 Feb 2015 11:33:18 GMT

    [ https://jira.codehaus.org/browse/MNG-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=363234#comment-363234
] 

Robert Scholte commented on MNG-5082:
-------------------------------------

IMHO all dependencies which are not part of the reactor should be available at startup of
the build, which is required to make a valid buildPlan. So even though this used to work with
Maven2, I think the approach of Maven3 is better, since Maven can't detect which plugins will
effect the buildPlan at startup. I'd like to close this as {{Won't Fix}}.
Doing an {{install-file}} during {{validate}} means that it'll be execute during every build,
installing the same file over and over again. That's also a sign that this approach can't
be valid.


> Regression: Could not resolve dependencies for project
> ------------------------------------------------------
>
>                 Key: MNG-5082
>                 URL: https://jira.codehaus.org/browse/MNG-5082
>             Project: Maven
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 3.0.3
>            Reporter: Florian Brunner
>            Priority: Blocker
>         Attachments: MNG-5082-maven-core.patch
>
>
> Sometimes, when you need a jar, which is not available from a repository, and for some
reason you don't want to deploy it to the corporate repository (yet), you can do something
like this:
> {code:xml}
>          <build>
> 		<plugins>
>                         ...
> 			<plugin>
> 				<artifactId>maven-install-plugin</artifactId>
> 				<executions>
> 					<execution>
> 						<id>some-lib</id>
> 						<phase>validate</phase>
> 						<goals>
> 							<goal>install-file</goal>
> 						</goals>
> 						<configuration>
> 							<file>lib/some-lib-1.1.jar</file>
> 							<groupId>org.someorg.somelib</groupId>
> 							<artifactId>some-lib</artifactId>
> 							<version>1.1</version>
> 							<packaging>jar</packaging>
> 						</configuration>
> 					</execution>
> 				</executions>
> 			</plugin>
> 			...
> 		</plugins>
> 	</build>
> {code}
> And then you can declare a dependency on this lib like this:
> {code:xml}
>          <dependencies>
>                 ...
> 		<dependency>
> 			<groupId>org.someorg.somelib</groupId>
> 			<artifactId>some-lib</artifactId>
> 			<version>1.1</version>
> 		</dependency>
> 		...
> 	</dependencies>
> {code}
> This worked fine with {{Maven 2.2.1}} but not with {{Maven 3.0.3}} -> regression!
> {noformat}
> Error message:
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 0.951s
> [INFO] Finished at: Thu Apr 28 15:53:15 BST 2011
> [INFO] Final Memory: 4M/121M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project myproject: Could not resolve dependencies for
project someGroupId:someArtifactId:jar:0.1-SNAPSHOT: Could not find artifact org.someorg.somelib:some-lib:jar:1.1
in nexus (<nexus url>) -> [Help 1]
> [ERROR] 
> {noformat}
> There is a work-around, which at least works in some cases:
> {noformat}
> mvn clean validate
> mvn install
> {noformat}
> Some notes on this work-around:
> - install should call validate (which it does, but apparently with some side-effects).
It should not be necessary to call validate explicitly.
> - "mvn clean validate install" does not work! It shouldn't matter if you call "mvn clean
validate install" or "mvn clean validate" and "mvn install". Both should have the same result.
> - I currently don't see a way to specify in Jenkins/ Hudson to first execute "clean validate"
and then "install" -> broken build on continuous integration server which has to be fixed
manually
> - This work-around breaks the Maven way, because you cannot simply go to a project anymore
and just call "mvn clean install" to build it.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Mime
View raw message