You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andre M <mo...@gmail.com> on 2010/12/16 22:15:50 UTC

Maven 3 reports wrong version

I just upgraded to Maven3 from Maven2 today, and when I run "mvn.bat
-version", this is what I see:



    Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)

    Java version: 1.6.0_23

    Java home: C:\Java\jdk6

    Default locale: en_US, platform encoding: Cp1252

    OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"



I don't think it's my path, because I am in the bin directory of the maven 3
installation, and I have completed deleted my maven 2 directory.



In addition, when I try to use the new maven installation to do a "mvn clean
compile", I get the following error:



    FATAL ERROR: Unable to read settings.xml

    For more information, run with the -e flag



Running a "mvn -e clean compile" gets me the following output:



    + Error stacktraces are turned on.

    FATAL ERROR: Unable to read settings.xml

    Error stacktrace:

    org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Component descriptor cannot be found in the component repository:
org.apache.maven.settings.MavenSe

    ttingsBuilder.

            at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)

            at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)

            at
org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:402)

            at org.apache.maven.cli.MavenCli.main(MavenCli.java:202)

            at org.apache.maven.cli.MavenCli.main(MavenCli.java:100)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)

            at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)

            at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

            at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)



Why does my maven3 installation claim that it's version 2.2.1? And what can
I do to address the problem with reading settings.xml?


- André

Re: Maven 3 reports wrong version

Posted by Dennis Lundberg <de...@apache.org>.
On 2010-12-16 22:15, Andre M wrote:
> I just upgraded to Maven3 from Maven2 today, and when I run "mvn.bat
> -version", this is what I see:

Try ".\mvn.bat" just to be sure that it is not an issue with your path.

> 
>     Apache Maven 2.2.1 (r801777; 2009-08-06 13:16:01-0600)
> 
>     Java version: 1.6.0_23
> 
>     Java home: C:\Java\jdk6
> 
>     Default locale: en_US, platform encoding: Cp1252
> 
>     OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
> 
> 
> 
> I don't think it's my path, because I am in the bin directory of the maven 3
> installation, and I have completed deleted my maven 2 directory.
> 
> 
> 
> In addition, when I try to use the new maven installation to do a "mvn clean
> compile", I get the following error:
> 
> 
> 
>     FATAL ERROR: Unable to read settings.xml
> 
>     For more information, run with the -e flag
> 
> 
> 
> Running a "mvn -e clean compile" gets me the following output:
> 
> 
> 
>     + Error stacktraces are turned on.
> 
>     FATAL ERROR: Unable to read settings.xml
> 
>     Error stacktrace:
> 
>     org.codehaus.plexus.component.repository.exception.ComponentLookupException:
> Component descriptor cannot be found in the component repository:
> org.apache.maven.settings.MavenSe
> 
>     ttingsBuilder.
> 
>             at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
> 
>             at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)
> 
>             at
> org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:402)
> 
>             at org.apache.maven.cli.MavenCli.main(MavenCli.java:202)
> 
>             at org.apache.maven.cli.MavenCli.main(MavenCli.java:100)
> 
>             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 
>             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 
>             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> 
>             at java.lang.reflect.Method.invoke(Unknown Source)
> 
>             at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
> 
>             at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
> 
>             at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> 
>             at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> 
> 
> 
> Why does my maven3 installation claim that it's version 2.2.1? And what can
> I do to address the problem with reading settings.xml?
> 
> 
> - André
> 


-- 
Dennis Lundberg

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


Re: Maven 3 reports wrong version

Posted by Benjamin Bentmann <be...@udo.edu>.
Andre M wrote:

> I just upgraded to Maven3 from Maven2 today, and when I run "mvn.bat
> -version", this is what I see:
> [...]
>              at
> org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:402)
>
>              at org.apache.maven.cli.MavenCli.main(MavenCli.java:202)
>
>              at org.apache.maven.cli.MavenCli.main(MavenCli.java:100)
>
>              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
>              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>
>              at java.lang.reflect.Method.invoke(Unknown Source)
>
>              at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
>
>              at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
>
>              at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>
>              at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

This stack trace mentions classes which are exclusive to Maven 3.x or 
Maven 2.x, respectively. So you don't appear to be running a clean Maven 
3 distribution (unpacked Maven 3 on top of Maven 2?). Nuking your 
current Maven installation and re-downloading the distro might help.


Benjamin

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


Re: Maven 3 reports wrong version

Posted by Guo Du <mr...@duguo.org>.
On Fri, Dec 17, 2010 at 2:22 PM, Andre M <mo...@gmail.com> wrote:
> being run is indeed maven3.0.1bin\mvn.bat.
Do you have M2_HOME in environment pointed to old version?

-Guo

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


Re: Maven 3 reports wrong version

Posted by Andre M <mo...@gmail.com>.
Hm, this is still a mystery. I've run ./mvn.bat, and I get the same version
reported (2.2.1)
I downloaded a python script that simulates "which" (
http://nedbatchelder.com/code/utilities/wh_py.html) and the maven that is
being run is indeed maven3.0.1bin\mvn.bat.

Should I clear my local .m2 repository? Could some settings be persisted in
there somehow?

On Thu, Dec 16, 2010 at 9:58 PM, Wayne Fay <wa...@gmail.com> wrote:

> > I just upgraded to Maven3 from Maven2 today, and when I run "mvn.bat
> > -version", this is what I see:
>
> If you were on a Unix platform, I'd tell you to run "which mvn" to be
> sure that you're running the binary/batch file you believe you're
> executing... but you're on Windows.
>
> Perhaps use Sysinternals Process Monitor to be certain that you're
> actually running Maven3. I think you must not be, and there's another
> Maven2 install lurking on your drive/path somewhere.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven 3 reports wrong version

Posted by Wayne Fay <wa...@gmail.com>.
> I just upgraded to Maven3 from Maven2 today, and when I run "mvn.bat
> -version", this is what I see:

If you were on a Unix platform, I'd tell you to run "which mvn" to be
sure that you're running the binary/batch file you believe you're
executing... but you're on Windows.

Perhaps use Sysinternals Process Monitor to be certain that you're
actually running Maven3. I think you must not be, and there's another
Maven2 install lurking on your drive/path somewhere.

Wayne

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