CircularReference
asked on
LifecycleExecutionException when running Maven2 compile goal of a Java project
Hi,
I am getting an error with a Maven 2.0.4 compile goal of a Java 1.5 project. It has been built successfully before, just not by me and I am unable to figure out what is causing my issue. The error I am receiving when I have trace enabled is "org.apache.maven.lifecycl e.Lifecycl eExecution Exception: The plugin 'org.apache.maven.plugins: maven-reso urces-plug in' does not exist or no valid version could be found". I am using the default local repository of ~/.m2/repository and have my settings.xml there. The settings file lists four repositories with a personal remote repository as the default. The remote repository is actually on the same box but is referenced through a URL. The remote and local repositories both contain the maven-resources-plugin, associated pom and sha1 hash files, for versions 2.1 and 2.2. Also, metadata.xml files exist from each of the remote repos the settings file lists. These metadata files contain current version information. It's intriguing that several of them contain the active version as LATEST. I was wondering if this was the problem so I created a LATEST directory in the maven2 repo structure and re-ran the build to no effect. I also tried removing these metadata.xml files and still got the same error. In fact, it seems to not find it in the local and my remote repos so it goes out to the other remote repos specified and attempts to download from each of them. That's where the metadata.xml files come from. So, they were just replaced when I removed them. Lastly, I have tried commenting out various repository definitions in the settings.xml and pom.xml to no effect. Below, I have included first) the log of the failure, second) the repos declared in the settings.xml, third) the pom.xml declaration, fourth) a sample of the metadata.xml files.
Please help! : )
//************************ ********** ********** ** Log of build ************************** ********** ***
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] -------------------------- ---------- ---------- ---------- ---------- ----------
[INFO] Building Maven Default Project
[INFO] task-segment: [compile]
[INFO] -------------------------- ---------- ---------- ---------- ---------- ----------
[INFO] artifact org.apache.maven.plugins:m aven-resou rces-plugi n: checking for updates from central
[INFO] -------------------------- ---------- ---------- ---------- ---------- ------
[ERROR] BUILD ERROR
[INFO] -------------------------- ---------- ---------- ---------- ---------- ------
[INFO] The plugin 'org.apache.maven.plugins: maven-reso urces-plug in' does not exist or no valid version could be found
[INFO] -------------------------- ---------- ---------- ---------- ---------- ------
[INFO] Trace
org.apache.maven.lifecycle .Lifecycle ExecutionE xception: The plugin 'org.apache.maven.plugins: maven-reso urces-plug in' does not exist or no valid version could be found
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.veri fyPlugin(D efaultLife cycleExecu tor.java:1 281)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.getM ojoDescrip tor(Defaul tLifecycle Executor.j ava:1517)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.bind LifecycleF orPackagin g(DefaultL ifecycleEx ecutor.jav a:1011)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.cons tructLifec ycleMappin gs(Default LifecycleE xecutor.ja va:975)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.exec uteGoal(De faultLifec ycleExecut or.java:45 3)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.exec uteGoalAnd HandleFail ures(Defau ltLifecycl eExecutor. java:306)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.exec uteTaskSeg ments(Defa ultLifecyc leExecutor .java:273)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.exec ute(Defaul tLifecycle Executor.j ava:140)
at org.apache.maven.DefaultMa ven.doExec ute(Defaul tMaven.jav a:322)
at org.apache.maven.DefaultMa ven.execut e(DefaultM aven.java: 115)
at org.apache.maven.cli.Maven Cli.main(M avenCli.ja va:256)
at sun.reflect.NativeMethodAc cessorImpl .invoke0(N ative Method)
at sun.reflect.NativeMethodAc cessorImpl .invoke(Na tiveMethod AccessorIm pl.java:39 )
at sun.reflect.DelegatingMeth odAccessor Impl.invok e(Delegati ngMethodAc cessorImpl .java:25)
at java.lang.reflect.Method.i nvoke(Meth od.java:58 5)
at org.codehaus.classworlds.L auncher.la unchEnhanc ed(Launche r.java:315 )
at org.codehaus.classworlds.L auncher.la unch(Launc her.java:2 55)
at org.codehaus.classworlds.L auncher.ma inWithExit Code(Launc her.java:4 30)
at org.codehaus.classworlds.L auncher.ma in(Launche r.java:375 )
Caused by: org.apache.maven.plugin.ve rsion.Plug inVersionN otFoundExc eption: The plugin 'org.apache.maven.plugins: maven-reso urces-plug in' does not exist or no valid version could be found
at org.apache.maven.plugin.ve rsion.Defa ultPluginV ersionMana ger.resolv ePluginVer sion(Defau ltPluginVe rsionManag er.java:22 5)
at org.apache.maven.plugin.ve rsion.Defa ultPluginV ersionMana ger.resolv ePluginVer sion(Defau ltPluginVe rsionManag er.java:87 )
at org.apache.maven.plugin.De faultPlugi nManager.v erifyPlugi n(DefaultP luginManag er.java:15 8)
at org.apache.maven.lifecycle .DefaultLi fecycleExe cutor.veri fyPlugin(D efaultLife cycleExecu tor.java:1 252)
... 18 more
[INFO] -------------------------- ---------- ---------- ---------- ---------- ------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Nov 29 15:46:11 EST 2006
[INFO] Final Memory: 1M/2M
[INFO] -------------------------- ---------- ---------- ---------- ---------- ------
//************************ ********** ********* settings.xml ************************** ********** ***
{Let me know if you need to see more of this file}
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
<localRepository>http://my-remote-repository.com/maven2/</localRe pository>
-->
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</int eractiveMo de>
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
<offline>false</offline>
-->
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.host.net</host >
<port>80</port>
<nonProxyHosts>local.net,s ome.host.c om</nonPro xyHosts>
</proxy>
-->
<proxy>
<id>proxy-1</id>
<active>true</active>
<protocol>http</protocol>
<host>my-remote-repository .com</host >
<port>80</port>
<nonProxyHosts>*.local-ser vers.com</ nonProxyHo sts>
</proxy>
<proxy>
<id>proxy-2</id>
<active>false</active>
<protocol>http</protocol>
<host>corp-proxy</host>
<port>8080</port>
<nonProxyHosts>*.local-ser vers.com</ nonProxyHo sts>
</proxy>
<proxy>
<id>proxy-3</id>
<active>false</active>
<protocol>http</protocol>
<host>corp-proxy2</host>
<port>8080</port>
<nonProxyHosts>*.local-ser vers.com</ nonProxyHo sts>
</proxy>
</proxies>
//************************ ********** ***** pom.xml ************************** ********** ********** ****
<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</model Version>
<groupId>com.myapp</groupI d>
<artifactId>myapp-app</art ifactId>
<packaging>pom</packaging>
<version>1.0</version>
<name>myapp</name>
<!-- $Id: pom.xml,v 1.4 2006/10/18 20:15:50 ME Exp $ -->
<repositories>
<repository>
<id>my-central</id>
<name>Maven 2 Repository</name>
<layout>default</layout>
<url>http://my-remote-repository.com/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<modules>
<module>myapp-ejbs</module >
<module>myapp-webapp</modu le>
<module>myapp-ear</module>
</modules>
<dependencies>
<dependency>
<groupId>commons-logging</ groupId>
<artifactId>commons-loggin g</artifac tId>
<version>1.0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifac tId>
<version>3.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</group Id>
<artifactId>testng</artifa ctId>
<version>4.7</version>
<scope>test</scope>
<classifier>jdk15</classif ier>
</dependency>
</dependencies>
</project>
//************************ ********** * Sample of metadata.xml files ************************** **********
{These can be seen from the remote repository urls listed above in the settings.xml file. Just open in your browser, go to org -> apache -> maven -> plugins.}
<?xml version="1.0" encoding="UTF-8"?><metadat a>
<groupId>org.apache.maven. plugins</g roupId>
<artifactId>maven-resource s-plugin</ artifactId >
<version>LATEST</version>
</metadata>
- OR - {I'm seeing both of these types}
<?xml version="1.0"?><metadata>
<groupId>org.apache.maven. plugins</g roupId>
<artifactId>maven-resource s-plugin</ artifactId >
<versioning>
<latest>2.2</latest>
<release>2.2</release>
<versions>
<version>2.0-beta-1</versi on>
<version>2.0-beta-2</versi on>
<version>2.0</version>
<version>2.1</version>
<version>2.2</version>
</versions>
<lastUpdated>2006051404191 1</lastUpd ated>
</versioning>
</metadata>
I am getting an error with a Maven 2.0.4 compile goal of a Java 1.5 project. It has been built successfully before, just not by me and I am unable to figure out what is causing my issue. The error I am receiving when I have trace enabled is "org.apache.maven.lifecycl
Please help! : )
//************************
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] --------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [compile]
[INFO] --------------------------
[INFO] artifact org.apache.maven.plugins:m
[INFO] --------------------------
[ERROR] BUILD ERROR
[INFO] --------------------------
[INFO] The plugin 'org.apache.maven.plugins:
[INFO] --------------------------
[INFO] Trace
org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.lifecycle
at org.apache.maven.DefaultMa
at org.apache.maven.DefaultMa
at org.apache.maven.cli.Maven
at sun.reflect.NativeMethodAc
at sun.reflect.NativeMethodAc
at sun.reflect.DelegatingMeth
at java.lang.reflect.Method.i
at org.codehaus.classworlds.L
at org.codehaus.classworlds.L
at org.codehaus.classworlds.L
at org.codehaus.classworlds.L
Caused by: org.apache.maven.plugin.ve
at org.apache.maven.plugin.ve
at org.apache.maven.plugin.ve
at org.apache.maven.plugin.De
at org.apache.maven.lifecycle
... 18 more
[INFO] --------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Nov 29 15:46:11 EST 2006
[INFO] Final Memory: 1M/2M
[INFO] --------------------------
//************************
{Let me know if you need to see more of this file}
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
<localRepository>http://my-remote-repository.com/maven2/</localRe
-->
<!-- interactiveMode
| This will determine whether maven prompts you when it needs input. If set to false,
| maven will use a sensible default value, perhaps based on some other setting, for
| the parameter in question.
|
| Default: true
<interactiveMode>true</int
-->
<!-- offline
| Determines whether maven should attempt to connect to the network when executing a build.
| This will have an effect on artifact downloads, artifact deployment, and others.
|
| Default: false
<offline>false</offline>
-->
<!-- proxies
| This is a list of proxies which can be used on this machine to connect to the network.
| Unless otherwise specified (by system property or command-line switch), the first proxy
| specification in this list marked as active will be used.
|-->
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.host.net</host
<port>80</port>
<nonProxyHosts>local.net,s
</proxy>
-->
<proxy>
<id>proxy-1</id>
<active>true</active>
<protocol>http</protocol>
<host>my-remote-repository
<port>80</port>
<nonProxyHosts>*.local-ser
</proxy>
<proxy>
<id>proxy-2</id>
<active>false</active>
<protocol>http</protocol>
<host>corp-proxy</host>
<port>8080</port>
<nonProxyHosts>*.local-ser
</proxy>
<proxy>
<id>proxy-3</id>
<active>false</active>
<protocol>http</protocol>
<host>corp-proxy2</host>
<port>8080</port>
<nonProxyHosts>*.local-ser
</proxy>
</proxies>
//************************
<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</model
<groupId>com.myapp</groupI
<artifactId>myapp-app</art
<packaging>pom</packaging>
<version>1.0</version>
<name>myapp</name>
<!-- $Id: pom.xml,v 1.4 2006/10/18 20:15:50 ME Exp $ -->
<repositories>
<repository>
<id>my-central</id>
<name>Maven 2 Repository</name>
<layout>default</layout>
<url>http://my-remote-repository.com/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<modules>
<module>myapp-ejbs</module
<module>myapp-webapp</modu
<module>myapp-ear</module>
</modules>
<dependencies>
<dependency>
<groupId>commons-logging</
<artifactId>commons-loggin
<version>1.0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifac
<version>3.8.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</group
<artifactId>testng</artifa
<version>4.7</version>
<scope>test</scope>
<classifier>jdk15</classif
</dependency>
</dependencies>
</project>
//************************
{These can be seen from the remote repository urls listed above in the settings.xml file. Just open in your browser, go to org -> apache -> maven -> plugins.}
<?xml version="1.0" encoding="UTF-8"?><metadat
<groupId>org.apache.maven.
<artifactId>maven-resource
<version>LATEST</version>
</metadata>
- OR - {I'm seeing both of these types}
<?xml version="1.0"?><metadata>
<groupId>org.apache.maven.
<artifactId>maven-resource
<versioning>
<latest>2.2</latest>
<release>2.2</release>
<versions>
<version>2.0-beta-1</versi
<version>2.0-beta-2</versi
<version>2.0</version>
<version>2.1</version>
<version>2.2</version>
</versions>
<lastUpdated>2006051404191
</versioning>
</metadata>
ASKER
Java versions 1.4.2_10 and 1.5.0_06 are both installed. 1.5.0_06 is setup as the JAVA_HOME and path.
ASKER
An update: I realized that there are plugin repositories separate from the normal repository declaration in the settings.xml and pom.xml files. I have the below plugin repositories declared in my settings.xml. I have tried commenting them out (all in the settings.xml and pom.xml) and it prevents the metadata.xml files from being downloaded to my local repository as I mentioned above. However, it does not fix the problem. I have also tried to compile another maven 2 project that works successfully for others and I get the same issue locally. I tried doing a maven help:describe goal and got the same error for the help plugin so this problem is for all plugins on my system. I also discovered that the maven-resources-plugin is the first mojo (a Maven unit of work) in the compile goal that I'm executing. The original command I was executing to get the error is "mvn -U -e compile" from the projects directory. The -U and -e only tell Maven to be verbose and put it in trace mode.
thanks in advance for any help!
//************************ ** Plugin Repositories from settings.xml ************************** ********** ******
<pluginRepositories>
<pluginRepository>
<id>maven.org-plugin</id>
<name>Apache Plugin Repo</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat ePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>lsu.edu-plugin</id>
<name>LSU Plugin Repo</name>
<url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat ePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>codehaus.org-plugin</i d>
<name>Codehaus Plugin Repository</name>
<url>http://repository.codehaus.org/</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat ePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
thanks in advance for any help!
//************************
<pluginRepositories>
<pluginRepository>
<id>maven.org-plugin</id>
<name>Apache Plugin Repo</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat
</snapshots>
</pluginRepository>
<pluginRepository>
<id>lsu.edu-plugin</id>
<name>LSU Plugin Repo</name>
<url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat
</snapshots>
</pluginRepository>
<pluginRepository>
<id>codehaus.org-plugin</i
<name>Codehaus Plugin Repository</name>
<url>http://repository.codehaus.org/</url>
<layout>legacy</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updat
</snapshots>
</pluginRepository>
</pluginRepositories>
Can you try compiling on a machine that only has 1 Java instance installed?
I had a pain once with Eclipse where my local app server was running a different Java to the IDE, it only got fixed when I removed the older Java. If that doesn't solve it then it sounds to me as more like a configuration issue than a compile issue (as in config is causing compile). The error:
The plugin 'org.apache.maven.plugins: maven-reso urces-plug in' does not exist or no valid version could be found
Sounds very much like the class isn't where it is expected to be, so check all the configuration files are pointing to the right class in your app. Sorry its a bit vague but there is so much information to read through its hard to see the wood through the trees... my tip would be to try and isolate where the problem is, and then fingers crossed it'll become obvious (although I'm guessing you've been trying to isolate for a while).
I had a pain once with Eclipse where my local app server was running a different Java to the IDE, it only got fixed when I removed the older Java. If that doesn't solve it then it sounds to me as more like a configuration issue than a compile issue (as in config is causing compile). The error:
The plugin 'org.apache.maven.plugins:
Sounds very much like the class isn't where it is expected to be, so check all the configuration files are pointing to the right class in your app. Sorry its a bit vague but there is so much information to read through its hard to see the wood through the trees... my tip would be to try and isolate where the problem is, and then fingers crossed it'll become obvious (although I'm guessing you've been trying to isolate for a while).
ASKER
Thanks Dasmaer. I'll try your suggestions. I apologize for the length of the information but as you mention, I've been trying to narrow the problem down for awhile.
ASKER
Well, it wasn't the other java instance and the configuration files were pointing to the right class. However, I was able to track down the problem. The problem had to do with the proxy settings. Maven is constantly accessing the web to check online repositories and it must have been checking the web even though I had the plugin local and had specified the local repository and my remote repository as the defaults. When it went to check the web, it encountered a problem with the proxy and gave the above somewhat misleading error. When I removed the proxy setting, the project built successfully. You would think I could tell it not to attempt to check the central repository but it seems to check it regardless of my settings.
Thanks for trying to help dasmaer!
Thanks for trying to help dasmaer!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
D