You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daniel Rindt <dr...@visetics.com> on 2010/09/02 10:47:21 UTC
mvn package
Hello,
i couldn't package my project anymore. I am using the provided Maven2
packages of my linux distribution. So can't understand why the version
mismatch is here. The ~/.m2 directory i have temporary moved, but that
seems not the problem. Please take a look here:
=== 8< ===
$ mvn package
/usr
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building xxxxxxxxxxxx Webapp
[INFO] task-segment: [package]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error resolving version for
'org.apache.maven.plugins:maven-compiler-plugin': Plugin requires Maven
version 2.0.9
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Sep 02 10:41:34 CEST 2010
[INFO] Final Memory: 2M/4M
[INFO]
------------------------------------------------------------------------
[drindt@localhost ]$ rpm -qa|grep maven
maven-surefire-2.3-7.7.fc12.noarch
maven2-plugin-compiler-2.0.8-3.fc12.noarch
maven-scm-1.2-5.fc13.noarch
maven-shared-invoker-2.0.7-4.fc13.noarch
maven-shared-test-tools-1.0-4.fc13.noarch
maven-shared-plugin-testing-tools-1.0-4.fc13.noarch
maven-wagon-1.0-0.2.b2.7.fc12.noarch
maven-shared-verifier-1.2-4.fc13.noarch
maven2-2.0.8-3.fc12.noarch
maven-jxr-2.1-6.fc12.noarch
maven-enforcer-rule-api-1.0-0.1.a2.1.5.fc12.noarch
maven-shared-common-artifact-filters-1.0-4.fc13.noarch
maven-doxia-1.0-0.8.a10.4.fc13.noarch
maven-shared-io-1.1-4.fc13.noarch
maven2-plugin-eclipse-2.0.8-3.fc12.noarch
maven2-common-poms-1.0-12.fc13.noarch
maven-scm-test-1.2-5.fc13.noarch
maven-shared-8-4.fc13.noarch
maven-shared-monitor-1.0-4.fc13.noarch
maven-shared-repository-builder-1.0-4.fc13.noarch
maven-shared-jar-1.1-4.fc13.noarch
maven-shared-model-converter-2.3-4.fc13.noarch
maven-shared-file-management-1.2-4.fc13.noarch
=== >8 ===
maybe the package "maven2-plugin-compiler" is not providing the
capabilities for the "maven-compiler-plugin". How can i fix that?
Thanks in advance
Daniel
RE: mvn package
Posted by Martin Gainty <mg...@hotmail.com>.
I dont believe antlr has compile goal in any of the V2 plugins try one of the antlr-plugins such as maven-castor-plugin
In the event you do'nt have internet access and want to demo offline try
download ANTLR from svn checkout http://svn.codehaus.org/mojo/trunk mojo
cd mojo
--determine which folder you will need e.g. solaris / weblogic / was6 ..I use castor alot so i cd castor-maven-plugin
cd castor-maven-plugin
mvn compile
mvn package
--install to local repository
mvn install:install-file -DgroupId=org.codehaus.mojo -DartifactId=castor-maven-plugin
-Dversion=2.1-SNAPSHOT -Dfile=pom.xml -Dpackaging=pom
--make SURE the maven-plugin's plugin.xml is located in ./META-INF/maven/plugin.xml then install
mvn install:install-file -DgroupId=org.codehaus.mojo -DartifactId=castor-maven-plugin
-Dversion=2.1-SNAPSHOT -Dfile=pom.xml -Dpackaging=maven-plugin
--you *can* mvn deploy:deploy-file or simply copy the file up such as what is seen here
cp ./target/castor-maven-plugin-2.1-SNAPSHOT.jar
.${user.home}/.m2/repository/org/codehaus/mojo/target/castor-maven-plugin-2.1-SNAPSHOT.jar
--to test grep for all goals in *Mojo.java
grep -S -l "@goal" *Mojo.java
--i've determined there is a help goal so i will call the help goal of castor-maven-plugin with
mvn -e -X org.codehaus.mojo:castor-maven-plugin:2.1-SNAPSHOT:help
i've experienced this same problem with struts-plugins and have used this methodology successfully
Ciao
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Date: Thu, 2 Sep 2010 11:45:34 +0200
> Subject: Re: mvn package
> From: antonio.petrelli@gmail.com
> To: users@maven.apache.org; drindt@visetics.com
>
> 2010/9/2 Daniel Rindt <dr...@visetics.com>:
> > Am Donnerstag, den 02.09.2010, 11:17 +0200 schrieb Antonio Petrelli:
> >> It seems that in your pom you specify explicitly the need of Maven
> >> 2.0.9. What do you see when you run mvn -version?
> > It was as you mentioned. I updated maven2 by hand to 2.2.1, but now i
> > got next errors during the packaging task.
> > ...
> > [WARNING] POM for 'antlr:antlr:pom:2.7.6:compile' is invalid.
> > ...
> > error: error
> > reading /home/drindt/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar;
> > error in opening zip file
>
> AFAICT, it seems that you have a problem with accessing your local
> repository, maybe they cannot be accessed or they are corrupt.
> This is strange. Did you try with a normal Maven distribution?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
Re: mvn package
Posted by Daniel Rindt <dr...@visetics.com>.
Am Donnerstag, den 02.09.2010, 11:45 +0200 schrieb Antonio Petrelli:
>
> AFAICT, it seems that you have a problem with accessing your local
> repository, maybe they cannot be accessed or they are corrupt.
> This is strange. Did you try with a normal Maven distribution?
Yes, the problem was maybe the version maven2-2.0.8, had problems with
repositories defined in the pom.xml. I cleaned up the repositories in
pom.xml and define just jboss repo. After deletion of ~/.m2 and rerun
mvn package it runs properly.
Thanks for your support Antonio.
Daniel
Re: mvn package
Posted by Antonio Petrelli <an...@gmail.com>.
2010/9/2 Daniel Rindt <dr...@visetics.com>:
> Am Donnerstag, den 02.09.2010, 11:17 +0200 schrieb Antonio Petrelli:
>> It seems that in your pom you specify explicitly the need of Maven
>> 2.0.9. What do you see when you run mvn -version?
> It was as you mentioned. I updated maven2 by hand to 2.2.1, but now i
> got next errors during the packaging task.
> ...
> [WARNING] POM for 'antlr:antlr:pom:2.7.6:compile' is invalid.
> ...
> error: error
> reading /home/drindt/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar;
> error in opening zip file
AFAICT, it seems that you have a problem with accessing your local
repository, maybe they cannot be accessed or they are corrupt.
This is strange. Did you try with a normal Maven distribution?
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: mvn package
Posted by Daniel Rindt <dr...@visetics.com>.
Am Donnerstag, den 02.09.2010, 11:17 +0200 schrieb Antonio Petrelli:
> It seems that in your pom you specify explicitly the need of Maven
> 2.0.9. What do you see when you run mvn -version?
It was as you mentioned. I updated maven2 by hand to 2.2.1, but now i
got next errors during the packaging task.
=== 8< ===
[drindt@localhost xxxxxxxxxxxxxxx]$ mvn -e package
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building xxxxxxxxxxxxxxx Webapp
[INFO] task-segment: [package]
[INFO]
------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[WARNING] POM for 'antlr:antlr:pom:2.7.6:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for
'commons-collections:commons-collections:pom:3.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'dom4j:dom4j:pom:1.6.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'commons-logging:commons-logging:pom:1.1.1:compile' is
invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'ognl:ognl:pom:2.7.3:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for
'commons-fileupload:commons-fileupload:pom:1.2.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'commons-io:commons-io:pom:1.3.2:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'mysql:mysql-connector-java:pom:5.1.13:compile' is
invalid.
Its dependencies (if any) will NOT be available to the current build.
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file
to /home/drindt/Programmierung/xxxxxxxxxxxxxxx/target/classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
error: error
reading /home/drindt/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar;
error in opening zip file
error: error
reading /home/drindt/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar; error in opening zip file
error: error
reading /home/drindt/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar;
error in opening zip file
error: error
reading /home/drindt/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar; error in opening zip file
error: error
reading /home/drindt/.m2/repository/ognl/ognl/2.7.3/ognl-2.7.3.jar;
error in opening zip file
error: error
reading /home/drindt/.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar; error in opening zip file
error: error
reading /home/drindt/.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar; error in opening zip file
error: error
reading /home/drindt/.m2/repository/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar; error in opening zip file
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException:
Compilation failure
at
org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Sep 02 11:33:52 CEST 2010
[INFO] Final Memory: 9M/16M
[INFO]
------------------------------------------------------------------------
=== >8 ===
My pom.xml:
=== 8< ===
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxxxxxxxxxxxxxx.app</groupId>
<artifactId>xxxxxxxxxxxxxxx</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>xxxxxxxxxxxxxxx Webapp</name>
<url>http://www.xxxxxxxxxxxxxxx.com</url>
<issueManagement>
<system>Trac</system>
<url>https://www2.xxxxxxxxxxxxxxx/report</url>
</issueManagement>
<scm>
<url>https://www2.xxxxxxxxxxxxxxx</url>
</scm>
<build>
<finalName>xxxxxxxxxxxxxxx</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version>2.0.2</version> -->
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.5.4-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.4-Final</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.13</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jboss-repository</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
<repository>
<id>apache.snapshots</id>
<name>ASF Maven 2 Snapshot</name>
<url>http://people.apache.org/builds/struts/2.1.8.1/m2-staging-repository</url>
</repository>
<repository>
<id>mavenrepository.snapshots</id>
<name>Maven Repository</name>
<url>http://mvnrepository.com/artifact</url>
</repository>
</repositories>
</project>
=== >8 ===
Daniel
Re: mvn package
Posted by Antonio Petrelli <an...@gmail.com>.
2010/9/2 Daniel Rindt <dr...@visetics.com>:
> [INFO] Error resolving version for
> 'org.apache.maven.plugins:maven-compiler-plugin': Plugin requires Maven
> version 2.0.9
It seems that in your pom you specify explicitly the need of Maven
2.0.9. What do you see when you run mvn -version?
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org