You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris de Vries <ch...@gmail.com> on 2013/04/29 11:26:38 UTC

Maven 3.0.5 eclipse:eclipse reports a BULD SUCCES while dependency does not exist.

I have the following dependency in my pom but this version does not exist
in our repository. Maven then tries to download it from
http://repo1.maven.org/ where of course this package also does not exists.
But Maven reports BUILD SUCCESS while there are unresolved packages. Is
this normal behavior or is this a bug?

I spent some time to figure out that I was using a wrong version. If Maven
had given any sort of warning it would have saved me some time.
So if this is by design then it would be a nice feature to have a warning
of some sort.



<dependency>
   <groupId>nl.cjib.clients</groupId>
   <artifactId>zakenregister-client</artifactId>
   <version>8.3.0.0</version>
                </dependency>

[INFO] [INFO]
------------------------------------------------------------------------
[INFO] Building dwangproforma-service-war 6.0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------
[INFO] [INFO] >>> maven-eclipse-plugin:2.8:eclipse (default-cli) @
dwangproforma-service-war >>> [INFO] [INFO] <<<
maven-eclipse-plugin:2.8:eclipse (default-cli) @ dwangproforma-service-war
<<< [INFO] [INFO] --- maven-eclipse-plugin:2.8:eclipse (default-cli) @
dwangproforma-service-war --- [WARNING] The POM for
org.apache.maven:maven-repository-metadata:jar:2.0 is missing, no
dependency information available [INFO] Adding support for WTP version R7.
[INFO] Using Eclipse Workspace: null [INFO] Adding default classpath
container: org.eclipse.jdt.launching.JRE_CONTAINER Downloading:
http://repo1.maven.org/maven2/nl/cjib/clients/zakenregister-client/8.3.0.0/zakenregister-client-8.3.0.0.pom[INFO]
File
D:\work\java\dwangproforma-service-accelerate\dwangproforma-service-war\.project
already exists. Additional settings will be preserved, run mvn
eclipse:clean if you want old settings to be removed. [INFO] Wrote Eclipse
project for "dwangproforma-service-war" to
D:\work\java\dwangproforma-service-accelerate\dwangproforma-service-war.
[INFO] [INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------
[INFO] Total time: 24.156s [INFO] Finished at: Mon Apr 29 10:53:35 CEST
2013 [INFO] Final Memory: 6M/18M [INFO]
------------------------------------------------------------------------

Settings look like this   (I placed some xxx's ;this is not the original
file but it should not matter for this post)

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<localRepository>D:\work\.m2\repository</localRepository>

<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>cjibcentral</id>
<name>libs-release</name>
<url>http://xxxxxxx:8080/nexus/content/repositories/releases</url>
</repository>

<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://xxxxxxx:8080/nexus/content/repositories/snapshots</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://xxxxxx:8080/nexus/content/repositories/releases</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://xxxxxxx:8080/nexus/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
</profile>


<profile>
<id>jbos</id>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
 <pluginRepositories>
<pluginRepository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>


<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>xxxxxx.xxx.nl</host>
<port>8080</port>
<username>xxxxxx</username>
<password>xxxxxx</password>
<nonProxyHosts>*.cjib.minjus.nl</nonProxyHosts>
</proxy>
</proxies>


</settings>

Re: Maven 3.0.5 eclipse:eclipse reports a BULD SUCCES while dependency does not exist.

Posted by Wayne Fay <wa...@gmail.com>.
> I have the following dependency in my pom but this version does not exist
> in our repository. Maven then tries to download it from
> http://repo1.maven.org/ where of course this package also does not exists.
> But Maven reports BUILD SUCCESS while there are unresolved packages. Is
> this normal behavior or is this a bug?
>
> I spent some time to figure out that I was using a wrong version. If Maven
> had given any sort of warning it would have saved me some time.
> So if this is by design then it would be a nice feature to have a warning
> of some sort.

There are two things going on here...

First, the purpose of the eclipse:eclipse goal is to simply take your
pom and produce Eclipse-compatible project files. So the
maven-eclipse-plugin does not really care (nor does it see other
functionality as part of its job) if the dependency artifacts exist in
your repo(s). If you want this to happen, you'd need to submit a patch
against the plugin to add the functionality.

Second, when you call a plugin goal directly like "mvn
eclipse:eclipse" then Maven does not run the full lifecycle, instead
it just invokes that goal directly. So Maven never has the opportunity
to complain about a missing artifact during an earlier lifecycle phase
as it would otherwise.

So, if you want to see these kinds of warnings or errors, I'd suggest
using "mvn validate eclipse:eclipse" instead. Revert the pom to
provide a "bad" version for a dependency and see if Maven complains as
you'd expect when you run it like this.

But ultimately, I think you shouldn't be using eclipse:eclipse at all.
Instead you should use M2E which is what "everyone" else is using.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org