Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IAM (Eclipse Integration for Apache Maven) » mvn goals fail, unless project compiled from Eclipse
mvn goals fail, unless project compiled from Eclipse [message #10983] Tue, 15 July 2008 00:05 Go to next message
Eclipse User
Originally posted by: rsabiq.vml.com

I'm trying to figure out why compile-and-beyond mvn goals fail, unless
project is compiled from Eclipse. All the dependencies in the eclipse
project are managed by Q for Eclipse. Q for Eclipse is probably not the
culprit here, i just don't understand why Eclipse-based compilation
succeeds, while mvn-based compilation fails, even when running goals from
Q for Eclipse.

The first error is:
package org.apache.log4j does not exist
and there is a bunch more for other dependencies.

P.S. mvn goals also fail to download dependencies like log4j and junit jar
(only poms get downloaded). The jars only appear to get downloaded into
repo when Eclipse-based build is performed (again project dependencies are
configured by Q for Eclipse).
P.P.S. Also noticed that when Eclipse-based project build is executed,
target.classes folder is present in target/classes.
P.P.P.S. My file-system mvn version is 2.0.9, whereas Q appears to be
using 2.1, but not sure if this matters because goals fail to compile from
Q as well.

Thanks.
Re: mvn goals fail, unless project compiled from Eclipse [message #10997 is a reply to message #10983] Tue, 15 July 2008 00:12 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

Even after the dependency jars are downloaded after Eclipse builds the
project, if i run
mvn clean
mvn package
compilation fails sayign log4j, etc. doesn't exist: even though i see them
in the repo.

P.S. This is happening for both 2.0.8, and 2.0.9.
P.P.S. What kind Alice's wonderland is going on here?

Thanks.
Re: mvn goals fail, unless project compiled from Eclipse [message #11009 is a reply to message #10983] Tue, 15 July 2008 13:15 Go to previous messageGo to next message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
It can be anything, from having a proxy to an error on your settings to a
corrupted repository or pom.xml.

You can get more information from maven by using -X (debug) or maybe also
-e (show errors). Maybe the information provided by the help plug-in can
be also useful:
http://maven.apache.org/plugins/maven-help-plugin/usage.html

Good luck!
Abel Muiño.
Re: mvn goals fail, unless project compiled from Eclipse [message #11020 is a reply to message #11009] Wed, 16 July 2008 23:23 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

I thought that maybe iam is using maven 2.1, and went ahead and installed
it from source (there were exceptions, like remote file not found, during
build, but all unit tests passed, and it installed successfully). However,
compilation fails even w/ 2.1-SNAPSHOT.

-X output screaming at me (no dependencieeeeeees!):

2.0.9:
[DEBUG] Classpath: [<project-path/>\target\classes]
2.1-SNAPSHOT:
[DEBUG] Classpath: [<project-path/>\target/classes]

The same for a successfully building project:
[DEBUG] Classpath: [<project2-path/>\target\target\classes
%USERPROFILE%\.m2\repository\commons-logging\commons-logging \1.1.1\commons-logging-1.1.1.jar
<many-more-repo-jars/>]

Anyway, i have no more ideas at the moment. If anybody is interested,
here's the list of dependencies in the mysteriously
non-maven-command-line-compilable w/o building from iam project:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.2.1.ga</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>jta</artifactId>
<groupId>javax.transaction</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jta</artifactId>
<version>1.0.1B-rc4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.5</version>
<scope>runtime</scope>
</dependency>
</dependencies>

P.S. Could be a bug having to do w/ transitive dependency resolution.
Maybe i'll try listing every dependency that iam shows in Eclipse's
project classpath explicitly and see if it builds then.

Thanks.
Re: mvn goals fail, unless project compiled from Eclipse [message #11032 is a reply to message #11020] Thu, 17 July 2008 09:46 Go to previous messageGo to next message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
Reshat Sabiq wrote:

> Anyway, i have no more ideas at the moment. If anybody is interested,
> here's the list of dependencies in the mysteriously
> non-maven-command-line-compilable w/o building from iam project:

...

Could you attach the full POM for testing?
Re: mvn goals fail, unless project compiled from Eclipse [message #11044 is a reply to message #11032] Thu, 17 July 2008 16:20 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

Abel Muiño wrote:
> Could you attach the full POM for testing?

Here's the part before dependencies (obfuscated):

<modelVersion>4.0.0</modelVersion>
<groupId>the.group</groupId>
<artifactId>the.artifact</artifactId>
<name>the.name</name>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<configuration>
<repositoryLayout>flat</repositoryLayout>
<repositoryName>lib</repositoryName>
<programs>
<program>
<mainClass>my.main.Klass</mainClass>
<name>theName</name>
</program>
</programs>
</configuration>
</plugin>
</plugins>
</build>
Re: mvn goals fail, unless project compiled from Eclipse [message #11055 is a reply to message #11044] Thu, 17 July 2008 23:18 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

Listing out all transitive dependencies explicitly hasn't helped. I need
Sherlock Holmes w/ his deductive method...
Re: mvn goals fail, unless project compiled from Eclipse [message #11065 is a reply to message #11055] Fri, 18 July 2008 21:48 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

I made project.xml, and it builds w/ maven 1.1, but of course i can't use
any build plugins there, and i disabled unit tests for now...
Funny and sad...
Re: mvn goals fail, unless project compiled from Eclipse [message #11075 is a reply to message #11065] Sat, 19 July 2008 12:53 Go to previous messageGo to next message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
I'm not sure how this is affected by the IAM Eclipse plug-in... Are you
still having problems? Or were your problems with the maven command line
tool?

Reshat Sabiq wrote:
> I made project.xml, and it builds w/ maven 1.1, but of course i can't
> use any build plugins there, and i disabled unit tests for now...
> Funny and sad...
>
Re: mvn goals fail, unless project compiled from Eclipse [message #12463 is a reply to message #11075] Mon, 21 July 2008 17:13 Go to previous messageGo to next message
Eclipse User
Originally posted by: rsabiq.vml.com

Yes, they were mvn-command-line related. Sorry if i wasn't clear enough on
that.

I logged a bug:
http://jira.codehaus.org/browse/MNG-3672

P.S. I think mvn acts like a nutcase sometimes. ;)
Re: mvn goals fail, unless project compiled from Eclipse [message #12482 is a reply to message #12463] Mon, 21 July 2008 17:42 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Case closed: it was an issue caused by bad dependency scope. Turned out to
be all my fault.
Re: mvn goals fail, unless project compiled from Eclipse [message #566477 is a reply to message #10983] Tue, 15 July 2008 00:12 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Even after the dependency jars are downloaded after Eclipse builds the
project, if i run
mvn clean
mvn package
compilation fails sayign log4j, etc. doesn't exist: even though i see them
in the repo.

P.S. This is happening for both 2.0.8, and 2.0.9.
P.P.S. What kind Alice's wonderland is going on here?

Thanks.
Re: mvn goals fail, unless project compiled from Eclipse [message #566498 is a reply to message #10983] Tue, 15 July 2008 13:15 Go to previous message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
It can be anything, from having a proxy to an error on your settings to a
corrupted repository or pom.xml.

You can get more information from maven by using -X (debug) or maybe also
-e (show errors). Maybe the information provided by the help plug-in can
be also useful:
http://maven.apache.org/plugins/maven-help-plugin/usage.html

Good luck!
Abel Muiño.
Re: mvn goals fail, unless project compiled from Eclipse [message #566536 is a reply to message #11009] Wed, 16 July 2008 23:23 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

I thought that maybe iam is using maven 2.1, and went ahead and installed
it from source (there were exceptions, like remote file not found, during
build, but all unit tests passed, and it installed successfully). However,
compilation fails even w/ 2.1-SNAPSHOT.

-X output screaming at me (no dependencieeeeeees!):

2.0.9:
[DEBUG] Classpath: [<project-path/>\target\classes]
2.1-SNAPSHOT:
[DEBUG] Classpath: [<project-path/>\target/classes]

The same for a successfully building project:
[DEBUG] Classpath: [<project2-path/>\target\target\classes
%USERPROFILE%\.m2\repository\commons-logging\commons-logging \1.1.1\commons-logging-1.1.1.jar
<many-more-repo-jars/>]

Anyway, i have no more ideas at the moment. If anybody is interested,
here's the list of dependencies in the mysteriously
non-maven-command-line-compilable w/o building from iam project:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.2.1.ga</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>jta</artifactId>
<groupId>javax.transaction</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jta</artifactId>
<version>1.0.1B-rc4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>0.7.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.5</version>
<scope>runtime</scope>
</dependency>
</dependencies>

P.S. Could be a bug having to do w/ transitive dependency resolution.
Maybe i'll try listing every dependency that iam shows in Eclipse's
project classpath explicitly and see if it builds then.

Thanks.
Re: mvn goals fail, unless project compiled from Eclipse [message #566560 is a reply to message #11020] Thu, 17 July 2008 09:46 Go to previous message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
Reshat Sabiq wrote:

> Anyway, i have no more ideas at the moment. If anybody is interested,
> here's the list of dependencies in the mysteriously
> non-maven-command-line-compilable w/o building from iam project:

...

Could you attach the full POM for testing?
Re: mvn goals fail, unless project compiled from Eclipse [message #566594 is a reply to message #11032] Thu, 17 July 2008 16:20 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Abel Muiño wrote:
> Could you attach the full POM for testing?

Here's the part before dependencies (obfuscated):

<modelVersion>4.0.0</modelVersion>
<groupId>the.group</groupId>
<artifactId>the.artifact</artifactId>
<name>the.name</name>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<configuration>
<repositoryLayout>flat</repositoryLayout>
<repositoryName>lib</repositoryName>
<programs>
<program>
<mainClass>my.main.Klass</mainClass>
<name>theName</name>
</program>
</programs>
</configuration>
</plugin>
</plugins>
</build>
Re: mvn goals fail, unless project compiled from Eclipse [message #566618 is a reply to message #11044] Thu, 17 July 2008 23:18 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Listing out all transitive dependencies explicitly hasn't helped. I need
Sherlock Holmes w/ his deductive method...
Re: mvn goals fail, unless project compiled from Eclipse [message #566646 is a reply to message #11055] Fri, 18 July 2008 21:48 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

I made project.xml, and it builds w/ maven 1.1, but of course i can't use
any build plugins there, and i disabled unit tests for now...
Funny and sad...
Re: mvn goals fail, unless project compiled from Eclipse [message #566671 is a reply to message #11065] Sat, 19 July 2008 12:53 Go to previous message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
I'm not sure how this is affected by the IAM Eclipse plug-in... Are you
still having problems? Or were your problems with the maven command line
tool?

Reshat Sabiq wrote:
> I made project.xml, and it builds w/ maven 1.1, but of course i can't
> use any build plugins there, and i disabled unit tests for now...
> Funny and sad...
>
Re: mvn goals fail, unless project compiled from Eclipse [message #566711 is a reply to message #11075] Mon, 21 July 2008 17:13 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Yes, they were mvn-command-line related. Sorry if i wasn't clear enough on
that.

I logged a bug:
http://jira.codehaus.org/browse/MNG-3672

P.S. I think mvn acts like a nutcase sometimes. ;)
Re: mvn goals fail, unless project compiled from Eclipse [message #566746 is a reply to message #12463] Mon, 21 July 2008 17:42 Go to previous message
Eclipse User
Originally posted by: rsabiq.vml.com

Case closed: it was an issue caused by bad dependency scope. Turned out to
be all my fault.
Previous Topic:mvn goals fail, unless project compiled from Eclipse
Next Topic:Error installing q4e plugin on Eclipse 3.4
Goto Forum:
  


Current Time: Tue Sep 23 08:30:30 GMT 2014

Powered by FUDForum. Page generated in 0.03916 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software