You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by RFatton <co...@hotmail.com> on 2009/08/11 15:00:11 UTC

FATAL ERROR: Unable to read settings.xml

Hi all, 

New to maven, having trouble getting it working.

I'm using ubuntu and ran "sudo apt-get install maven2" for install.

Also added M2_HOME=/usr/share/maven2, export M2=$M2_HOME/bin, export
PATH=$M2:$PATH to enviroment.

When I run mvn -version I get:

Maven version: 2.0.9
Java version: 1.5.0
OS name: "linux" version: "2.6.24-23-xen" arch: "x86_64" Family: "unix"

But when I try to do anything with mvn I get an error (full error below)
saying Unable to read settings.xml.

I've found the setting.xml at /etc/maven2/settings.xml
(/usr/share/maven2/conf is linked to this file location) so tried "mvn -s
/etc/maven2/settings.xml" and "mvn -s /usr/share/maven2/conf/settings.xml"
resulting in the sam error.

Tried copying settings.xml to ~/.m2, same error.

Same error when i tried very smiple settings.xml file with:

<settings 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/xsd/settings-1.0.0.xsd">
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>MYPROXY</host>
      <port>8080</port>
    </proxy>
  </proxies>

</settings>

and 

<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>MYPROXY</host>
      <port>8080</port>
    </proxy>
  </proxies>

</settings>


Does this error mean that maven can't find the settings.xml file? (if so how
do I fix it)

How do I know which settings.xml file is being used, system or user?

Do I need to edit settings.xml from it's default at the beginning? If so
wouldn't one of the simple versions I hev work?

Thanks for help,




ERROR:

When I try "mvn -e package":

+ Error stacktraces are turned on.
-----------------------------------------------------
this realm = plexus.core
urls[0] = file:/usr/share/maven2/lib/jsch.jar
urls[1] = file:/usr/share/maven2/lib/wagon-provider-api.jar
urls[2] = file:/usr/share/maven2/lib/wagon-file.jar
urls[3] = file:/usr/share/maven2/lib/doxia-sink-api.jar
urls[4] = file:/usr/share/maven2/lib/maven2.jar
urls[5] = file:/usr/share/maven2/lib/plexus-interactivity-api.jar
urls[6] = file:/usr/share/maven2/lib/wagon-ssh.jar
urls[7] = file:/usr/share/maven2/lib/wagon-ssh-external.jar
urls[8] = file:/usr/share/maven2/lib/xml-apis.jar
urls[9] = file:/usr/share/maven2/lib/plexus-interpolation.jar
urls[10] = file:/usr/share/maven2/lib/plexus-container-default.jar
urls[11] = file:/usr/share/maven2/lib/wagon-ssh-common.jar
urls[12] = file:/usr/share/maven2/lib/wagon-http-shared.jar
urls[13] = file:/usr/share/maven2/lib/wagon-http-lightweight.jar
urls[14] = file:/usr/share/maven2/lib/commons-cli.jar
urls[15] = file:/usr/share/maven2/lib/plexus-utils.jar
urls[16] = file:/usr/share/maven2/lib/jtidy.jar
Number of imports: 0
-----------------------------------------------------
FATAL ERROR: Unable to read settings.xml
Error stacktrace:
org.codehaus.plexus.component.repository.exception.ComponentLookupException:
Unable to lookup component 'org.apache.maven.settings.MavenSettingsBuilder',
it could not be created
   at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
   at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)
   at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:309)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
   at java.lang.reflect.Method.invoke(libgcj.so.90)
   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.codehaus.plexus.component.factory.ComponentInstantiationException: Could
not instanciate component: role:
'org.apache.maven.settings.MavenSettingsBuilder', implementation:
'org.apache.maven.settings.DefaultMavenSettingsBuilder'
   at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
   at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
   at
org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
   at
org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
   at
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
   at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
   ...8 more
Caused by: java.lang.NoClassDefFoundError:
org.apache.maven.settings.DefaultMavenSettingsBuilder
   at java.lang.Class.initializeClass(libgcj.so.90)
   at java.lang.Class.newInstance(libgcj.so.90)
   at
org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
   ...12 more
Caused by: java.lang.VerifyError: verification failed at PC 63 in
org.apache.maven.settings.DefaultMavenSettingsBuilder:readSettings((Ljava.io.File;)Lorg.apache.maven.settings.Settings;):
incompatible type on stack
   at java.lang.Class.initializeClass(libgcj.so.90)
   ...14 more



-- 
View this message in context: http://www.nabble.com/FATAL-ERROR%3A-Unable-to-read-settings.xml-tp24917137p24917137.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How to add SYSTEM scope dependency to manifest?

Posted by Wayne Fay <wa...@gmail.com>.
> The jar is not in any repository so I read it off of the file
> system by setting the dependency to <scope>system
> </scope> This is the only scope which can read jars
> off the file system.

You really must install this jar into a corporate repo (nexus etc) and
then depend on it with proper scopes. System scope is a bad idea in
general except for very specific uses -- and this is not one of them.

Wayne

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


Re: How to add SYSTEM scope dependency to manifest?

Posted by Brett Randall <ja...@gmail.com>.
If you can't or won't follow the advice to install the artifact into a
repository manager, then simply use install-file to install it to your
local repo, the change the scope to compile.

Best
Brett


On 8/13/09, REMIJAN, MICHAEL J [AG/1000] <mi...@monsanto.com> wrote:
> There are many reasons why a project would use a JAR file which isn't in a
> repository. So I'm assuming Maven cannot be configured to handle this?   It
> seems to me if I can configure the <dependencySet> to include
> <scope>system</scope> dependencies then I should also be able to make a
> similar configuration with the <manifest><addClasspath>.  Or is there
> another way of accomplishing the same thing?
>
> -----Original Message-----
> From: Brian Fox [mailto:brianf@infinity.nu]
> Sent: Wednesday, August 12, 2009 1:58 PM
> To: Maven Users List
> Subject: Re: How to add SYSTEM scope dependency to manifest?
>
> System scope is meant for system objects that would be present on the
> target os, something like MFC.dll etc. Using it to work around having
> the jar in a repository is a definite anti-pattern.  Instead have it
> uploaded to your Corporate Nexus repository.
>
> On Wed, Aug 12, 2009 at 1:10 PM, REMIJAN, MICHAEL J
> [AG/1000]<mi...@monsanto.com> wrote:
>> The jar is not in any repository so I read it off of the file system by
>> setting the dependency to <scope>system</scope> This is the only scope
>> which can read jars off the file system.  If the scope is changed to
>> compile, Maven will want to pull it from a repository.  The m2 plugin for
>> eclipse gives an error if <systemPath> is set and the scope is not system.
>>
>> -----Original Message-----
>> From: Wayne Fay [mailto:waynefay@gmail.com]
>> Sent: Wednesday, August 12, 2009 9:46 AM
>> To: Maven Users List
>> Subject: Re: How to add SYSTEM scope dependency to manifest?
>>
>>> if a dependency is defined as <scope>system</scope> then <addClasspath>
>>> does not include it in the manifest.  I need to include it in the
>>> manifest.  Any ideas?
>>
>> Is there a reason the obvious answer -- change it to a different scope
>> eg compile -- is not acceptable?
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------------------------------------------
>> This e-mail message may contain privileged and/or confidential
>> information, and is intended to be received only by persons entitled to
>> receive such information. If you have received this e-mail in error,
>> please notify the sender immediately. Please delete it and all attachments
>> from any servers, hard drives or any other media. Other use of this e-mail
>> by you is strictly prohibited.
>>
>>
>> All e-mails and attachments sent and received are subject to monitoring,
>> reading and archival by Monsanto, including its subsidiaries. The
>> recipient of this e-mail is solely responsible for checking for the
>> presence of "Viruses" or other "Malware". Monsanto, along with its
>> subsidiaries, accepts no liability for any damage caused by any such code
>> transmitted by or accompanying this e-mail or any attachment.
>> ---------------------------------------------------------------------------------------------------------
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------------------------------------------
> This e-mail message may contain privileged and/or confidential information,
> and is intended to be received only by persons entitled to receive such
> information. If you have received this e-mail in error, please notify the
> sender immediately. Please delete it and all attachments from any servers,
> hard drives or any other media. Other use of this e-mail by you is strictly
> prohibited.
>
>
> All e-mails and attachments sent and received are subject to monitoring,
> reading and archival by Monsanto, including its subsidiaries. The recipient
> of this e-mail is solely responsible for checking for the presence of
> "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts
> no liability for any damage caused by any such code transmitted by or
> accompanying this e-mail or any attachment.
> ---------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

-- 
Sent from my mobile device

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


RE: How to add SYSTEM scope dependency to manifest?

Posted by "REMIJAN, MICHAEL J [AG/1000]" <mi...@monsanto.com>.
There are many reasons why a project would use a JAR file which isn't in a repository. So I'm assuming Maven cannot be configured to handle this?   It seems to me if I can configure the <dependencySet> to include <scope>system</scope> dependencies then I should also be able to make a similar configuration with the <manifest><addClasspath>.  Or is there another way of accomplishing the same thing? 

-----Original Message-----
From: Brian Fox [mailto:brianf@infinity.nu] 
Sent: Wednesday, August 12, 2009 1:58 PM
To: Maven Users List
Subject: Re: How to add SYSTEM scope dependency to manifest?

System scope is meant for system objects that would be present on the
target os, something like MFC.dll etc. Using it to work around having
the jar in a repository is a definite anti-pattern.  Instead have it
uploaded to your Corporate Nexus repository.

On Wed, Aug 12, 2009 at 1:10 PM, REMIJAN, MICHAEL J
[AG/1000]<mi...@monsanto.com> wrote:
> The jar is not in any repository so I read it off of the file system by setting the dependency to <scope>system</scope> This is the only scope which can read jars off the file system.  If the scope is changed to compile, Maven will want to pull it from a repository.  The m2 plugin for eclipse gives an error if <systemPath> is set and the scope is not system.
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Wednesday, August 12, 2009 9:46 AM
> To: Maven Users List
> Subject: Re: How to add SYSTEM scope dependency to manifest?
>
>> if a dependency is defined as <scope>system</scope> then <addClasspath>
>> does not include it in the manifest.  I need to include it in the
>> manifest.  Any ideas?
>
> Is there a reason the obvious answer -- change it to a different scope
> eg compile -- is not acceptable?
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------------------------------------------
> This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.
>
>
> All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
> ---------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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



---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


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


Re: How to add SYSTEM scope dependency to manifest?

Posted by Brian Fox <br...@infinity.nu>.
System scope is meant for system objects that would be present on the
target os, something like MFC.dll etc. Using it to work around having
the jar in a repository is a definite anti-pattern.  Instead have it
uploaded to your Corporate Nexus repository.

On Wed, Aug 12, 2009 at 1:10 PM, REMIJAN, MICHAEL J
[AG/1000]<mi...@monsanto.com> wrote:
> The jar is not in any repository so I read it off of the file system by setting the dependency to <scope>system</scope> This is the only scope which can read jars off the file system.  If the scope is changed to compile, Maven will want to pull it from a repository.  The m2 plugin for eclipse gives an error if <systemPath> is set and the scope is not system.
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Wednesday, August 12, 2009 9:46 AM
> To: Maven Users List
> Subject: Re: How to add SYSTEM scope dependency to manifest?
>
>> if a dependency is defined as <scope>system</scope> then <addClasspath>
>> does not include it in the manifest.  I need to include it in the
>> manifest.  Any ideas?
>
> Is there a reason the obvious answer -- change it to a different scope
> eg compile -- is not acceptable?
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ---------------------------------------------------------------------------------------------------------
> This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.
>
>
> All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
> ---------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


RE: How to add SYSTEM scope dependency to manifest?

Posted by "REMIJAN, MICHAEL J [AG/1000]" <mi...@monsanto.com>.
The jar is not in any repository so I read it off of the file system by setting the dependency to <scope>system</scope> This is the only scope which can read jars off the file system.  If the scope is changed to compile, Maven will want to pull it from a repository.  The m2 plugin for eclipse gives an error if <systemPath> is set and the scope is not system.

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Wednesday, August 12, 2009 9:46 AM
To: Maven Users List
Subject: Re: How to add SYSTEM scope dependency to manifest?

> if a dependency is defined as <scope>system</scope> then <addClasspath>
> does not include it in the manifest.  I need to include it in the
> manifest.  Any ideas?

Is there a reason the obvious answer -- change it to a different scope
eg compile -- is not acceptable?

Wayne

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



---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


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


Re: How to add SYSTEM scope dependency to manifest?

Posted by Wayne Fay <wa...@gmail.com>.
> if a dependency is defined as <scope>system</scope> then <addClasspath>
> does not include it in the manifest.  I need to include it in the
> manifest.  Any ideas?

Is there a reason the obvious answer -- change it to a different scope
eg compile -- is not acceptable?

Wayne

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


How to add SYSTEM scope dependency to manifest?

Posted by "REMIJAN, MICHAEL J [AG/1000]" <mi...@monsanto.com>.
Greetings all,

I'm looking for how to configure the
<artifactId>maven-jar-plugin</artifactId> so that dependencies with
<scope>system</scope> are included in the class-path of the manifest.  I
already am using the <addClasspath> tag of <manifest> and that works but
if a dependency is defined as <scope>system</scope> then <addClasspath>
does not include it in the manifest.  I need to include it in the
manifest.  Any ideas?

Mike

---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


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


adding to an assembly

Posted by "REMIJAN, MICHAEL J [AG/1000]" <mi...@monsanto.com>.
I followed the pattern in the maven book and I have one project which
defines reusable assemblies, a parent-pom project which refers to those
assemblies in <build><pluginManagement>, and finally ProjectA which uses
the parent-pom.  Now my question is, how can ProjectA add to the
assemblies..specifically ProjectA needs to add a <dependencySet> which
is specific to ProjectA.  Is this possible to do in ProjectA's pom file?


---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware". Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


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


Re: FATAL ERROR: Unable to read settings.xml

Posted by Brett Randall <ja...@gmail.com>.
On Tue, Aug 11, 2009 at 11:00 PM, RFatton <co...@hotmail.com> wrote:

>
> Hi all,
>
> New to maven, having trouble getting it working.
>
> I'm using ubuntu and ran "sudo apt-get install maven2" for install.
>
> Also added M2_HOME=/usr/share/maven2, export M2=$M2_HOME/bin, export
> PATH=$M2:$PATH to enviroment.
>
> When I run mvn -version I get:
>
> Maven version: 2.0.9
> Java version: 1.5.0
> OS name: "linux" version: "2.6.24-23-xen" arch: "x86_64" Family: "unix"
>
> But when I try to do anything with mvn I get an error (full error below)
> saying Unable to read settings.xml.
>
> I've found the setting.xml at /etc/maven2/settings.xml
> (/usr/share/maven2/conf is linked to this file location) so tried "mvn -s
> /etc/maven2/settings.xml" and "mvn -s /usr/share/maven2/conf/settings.xml"
> resulting in the sam error.
>
> Tried copying settings.xml to ~/.m2, same error.
>
> Same error when i tried very smiple settings.xml file with:
>
> <settings 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/xsd/settings-1.0.0.xsd">
>  <proxies>
>   <proxy>
>      <active>true</active>
>      <protocol>http</protocol>
>      <host>MYPROXY</host>
>      <port>8080</port>
>    </proxy>
>  </proxies>
>
> </settings>
>
> and
>
> <settings>
>  <proxies>
>   <proxy>
>      <active>true</active>
>      <protocol>http</protocol>
>      <host>MYPROXY</host>
>      <port>8080</port>
>    </proxy>
>  </proxies>
>
> </settings>
>
>
> Does this error mean that maven can't find the settings.xml file? (if so
> how
> do I fix it)
>
> How do I know which settings.xml file is being used, system or user?
>
> Do I need to edit settings.xml from it's default at the beginning? If so
> wouldn't one of the simple versions I hev work?
>
> Thanks for help,
>
>
>
>
> ERROR:
>
> When I try "mvn -e package":
>
> + Error stacktraces are turned on.
> -----------------------------------------------------
> this realm = plexus.core
> urls[0] = file:/usr/share/maven2/lib/jsch.jar
> urls[1] = file:/usr/share/maven2/lib/wagon-provider-api.jar
> urls[2] = file:/usr/share/maven2/lib/wagon-file.jar
> urls[3] = file:/usr/share/maven2/lib/doxia-sink-api.jar
> urls[4] = file:/usr/share/maven2/lib/maven2.jar
> urls[5] = file:/usr/share/maven2/lib/plexus-interactivity-api.jar
> urls[6] = file:/usr/share/maven2/lib/wagon-ssh.jar
> urls[7] = file:/usr/share/maven2/lib/wagon-ssh-external.jar
> urls[8] = file:/usr/share/maven2/lib/xml-apis.jar
> urls[9] = file:/usr/share/maven2/lib/plexus-interpolation.jar
> urls[10] = file:/usr/share/maven2/lib/plexus-container-default.jar
> urls[11] = file:/usr/share/maven2/lib/wagon-ssh-common.jar
> urls[12] = file:/usr/share/maven2/lib/wagon-http-shared.jar
> urls[13] = file:/usr/share/maven2/lib/wagon-http-lightweight.jar
> urls[14] = file:/usr/share/maven2/lib/commons-cli.jar
> urls[15] = file:/usr/share/maven2/lib/plexus-utils.jar
> urls[16] = file:/usr/share/maven2/lib/jtidy.jar
> Number of imports: 0
> -----------------------------------------------------
> FATAL ERROR: Unable to read settings.xml
> Error stacktrace:
>
> org.codehaus.plexus.component.repository.exception.ComponentLookupException:
> Unable to lookup component
> 'org.apache.maven.settings.MavenSettingsBuilder',
> it could not be created
>   at
>
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
>   at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)
>   at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:309)
>   at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
>   at java.lang.reflect.Method.invoke(libgcj.so.90)
>   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.codehaus.plexus.component.factory.ComponentInstantiationException:
> Could
> not instanciate component: role:
> 'org.apache.maven.settings.MavenSettingsBuilder', implementation:
> 'org.apache.maven.settings.DefaultMavenSettingsBuilder'
>   at
>
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
>   at
>
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
>   at
>
> org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
>   at
>
> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
>   at
>
> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>   at
>
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
>   ...8 more
> Caused by: java.lang.NoClassDefFoundError:
> org.apache.maven.settings.DefaultMavenSettingsBuilder
>   at java.lang.Class.initializeClass(libgcj.so.90)
>   at java.lang.Class.newInstance(libgcj.so.90)
>   at
>
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
>   ...12 more
> Caused by: java.lang.VerifyError: verification failed at PC 63 in
>
> org.apache.maven.settings.DefaultMavenSettingsBuilder:readSettings((Ljava.io.File;)Lorg.apache.maven.settings.Settings;):
> incompatible type on stack
>   at java.lang.Class.initializeClass(libgcj.so.90)
>   ...14 more
>
>
>
> --
> View this message in context:
> http://www.nabble.com/FATAL-ERROR%3A-Unable-to-read-settings.xml-tp24917137p24917137.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
What does "java -version" report? Looks like you are running a pretty old
JDK, possibly a non-Sun one, maybe your distro's default gjc. Install a
current JDK if you are. Check your $JAVA_HOME setting and PATH.

Best
Brett

Re: FATAL ERROR: Unable to read settings.xml

Posted by RFatton <co...@hotmail.com>.
Thanks for your help, was indeed an issue with java. Seems to be working fine
now.

R



RFatton wrote:
> 
> Hi all, 
> 
> New to maven, having trouble getting it working.
> 
> I'm using ubuntu and ran "sudo apt-get install maven2" for install.
> 
> Also added M2_HOME=/usr/share/maven2, export M2=$M2_HOME/bin, export
> PATH=$M2:$PATH to enviroment.
> 
> When I run mvn -version I get:
> 
> Maven version: 2.0.9
> Java version: 1.5.0
> OS name: "linux" version: "2.6.24-23-xen" arch: "x86_64" Family: "unix"
> 
> But when I try to do anything with mvn I get an error (full error below)
> saying Unable to read settings.xml.
> 
> I've found the setting.xml at /etc/maven2/settings.xml
> (/usr/share/maven2/conf is linked to this file location) so tried "mvn -s
> /etc/maven2/settings.xml" and "mvn -s /usr/share/maven2/conf/settings.xml"
> resulting in the sam error.
> 
> Tried copying settings.xml to ~/.m2, same error.
> 
> Same error when i tried very smiple settings.xml file with:
> 
> <settings 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/xsd/settings-1.0.0.xsd">
>   <proxies>
>    <proxy>
>       <active>true</active>
>       <protocol>http</protocol>
>       <host>MYPROXY</host>
>       <port>8080</port>
>     </proxy>
>   </proxies>
> 
> </settings>
> 
> and 
> 
> <settings>
>   <proxies>
>    <proxy>
>       <active>true</active>
>       <protocol>http</protocol>
>       <host>MYPROXY</host>
>       <port>8080</port>
>     </proxy>
>   </proxies>
> 
> </settings>
> 
> 
> Does this error mean that maven can't find the settings.xml file? (if so
> how do I fix it)
> 
> How do I know which settings.xml file is being used, system or user?
> 
> Do I need to edit settings.xml from it's default at the beginning? If so
> wouldn't one of the simple versions I hev work?
> 
> Thanks for help,
> 
> 
> 
> 
> ERROR:
> 
> When I try "mvn -e package":
> 
> + Error stacktraces are turned on.
> -----------------------------------------------------
> this realm = plexus.core
> urls[0] = file:/usr/share/maven2/lib/jsch.jar
> urls[1] = file:/usr/share/maven2/lib/wagon-provider-api.jar
> urls[2] = file:/usr/share/maven2/lib/wagon-file.jar
> urls[3] = file:/usr/share/maven2/lib/doxia-sink-api.jar
> urls[4] = file:/usr/share/maven2/lib/maven2.jar
> urls[5] = file:/usr/share/maven2/lib/plexus-interactivity-api.jar
> urls[6] = file:/usr/share/maven2/lib/wagon-ssh.jar
> urls[7] = file:/usr/share/maven2/lib/wagon-ssh-external.jar
> urls[8] = file:/usr/share/maven2/lib/xml-apis.jar
> urls[9] = file:/usr/share/maven2/lib/plexus-interpolation.jar
> urls[10] = file:/usr/share/maven2/lib/plexus-container-default.jar
> urls[11] = file:/usr/share/maven2/lib/wagon-ssh-common.jar
> urls[12] = file:/usr/share/maven2/lib/wagon-http-shared.jar
> urls[13] = file:/usr/share/maven2/lib/wagon-http-lightweight.jar
> urls[14] = file:/usr/share/maven2/lib/commons-cli.jar
> urls[15] = file:/usr/share/maven2/lib/plexus-utils.jar
> urls[16] = file:/usr/share/maven2/lib/jtidy.jar
> Number of imports: 0
> -----------------------------------------------------
> FATAL ERROR: Unable to read settings.xml
> Error stacktrace:
> org.codehaus.plexus.component.repository.exception.ComponentLookupException:
> Unable to lookup component
> 'org.apache.maven.settings.MavenSettingsBuilder', it could not be created
>    at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:335)
>    at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)
>    at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:309)
>    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
>    at java.lang.reflect.Method.invoke(libgcj.so.90)
>    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.codehaus.plexus.component.factory.ComponentInstantiationException:
> Could not instanciate component: role:
> 'org.apache.maven.settings.MavenSettingsBuilder', implementation:
> 'org.apache.maven.settings.DefaultMavenSettingsBuilder'
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.makeException(JavaComponentFactory.java:77)
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:62)
>    at
> org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464)
>    at
> org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93)
>    at
> org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
>    at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
>    ...8 more
> Caused by: java.lang.NoClassDefFoundError:
> org.apache.maven.settings.DefaultMavenSettingsBuilder
>    at java.lang.Class.initializeClass(libgcj.so.90)
>    at java.lang.Class.newInstance(libgcj.so.90)
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44)
>    ...12 more
> Caused by: java.lang.VerifyError: verification failed at PC 63 in
> org.apache.maven.settings.DefaultMavenSettingsBuilder:readSettings((Ljava.io.File;)Lorg.apache.maven.settings.Settings;):
> incompatible type on stack
>    at java.lang.Class.initializeClass(libgcj.so.90)
>    ...14 more
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FATAL-ERROR%3A-Unable-to-read-settings.xml-tp24917137p24936956.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: FATAL ERROR: Unable to read settings.xml

Posted by Jonathan Woods <jo...@scintillance.com>.
Slightly lame suggestion, but... have you tried a different JVM, not
forgetting to set JAVA_HOME?  From your stack trace it's a JVM error, and
nothing to do with settings.xml files.

> -----Original Message-----
> From: RFatton [mailto:conorgaff@hotmail.com] 
> Sent: 11 August 2009 14:00
> To: users@maven.apache.org
> Subject: FATAL ERROR: Unable to read settings.xml
> 
> 
> Hi all, 
> 
> New to maven, having trouble getting it working.
> 
> I'm using ubuntu and ran "sudo apt-get install maven2" for install.
> 
> Also added M2_HOME=/usr/share/maven2, export M2=$M2_HOME/bin, 
> export PATH=$M2:$PATH to enviroment.
> 
> When I run mvn -version I get:
> 
> Maven version: 2.0.9
> Java version: 1.5.0
> OS name: "linux" version: "2.6.24-23-xen" arch: "x86_64" 
> Family: "unix"
> 
> But when I try to do anything with mvn I get an error (full 
> error below) saying Unable to read settings.xml.
> 
> I've found the setting.xml at /etc/maven2/settings.xml 
> (/usr/share/maven2/conf is linked to this file location) so 
> tried "mvn -s /etc/maven2/settings.xml" and "mvn -s 
> /usr/share/maven2/conf/settings.xml"
> resulting in the sam error.
> 
> Tried copying settings.xml to ~/.m2, same error.
> 
> Same error when i tried very smiple settings.xml file with:
> 
> <settings 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/xsd/settings-1.0.0.xsd">
>   <proxies>
>    <proxy>
>       <active>true</active>
>       <protocol>http</protocol>
>       <host>MYPROXY</host>
>       <port>8080</port>
>     </proxy>
>   </proxies>
> 
> </settings>
> 
> and 
> 
> <settings>
>   <proxies>
>    <proxy>
>       <active>true</active>
>       <protocol>http</protocol>
>       <host>MYPROXY</host>
>       <port>8080</port>
>     </proxy>
>   </proxies>
> 
> </settings>
> 
> 
> Does this error mean that maven can't find the settings.xml 
> file? (if so how do I fix it)
> 
> How do I know which settings.xml file is being used, system or user?
> 
> Do I need to edit settings.xml from it's default at the 
> beginning? If so wouldn't one of the simple versions I hev work?
> 
> Thanks for help,
> 
> 
> 
> 
> ERROR:
> 
> When I try "mvn -e package":
> 
> + Error stacktraces are turned on.
> -----------------------------------------------------
> this realm = plexus.core
> urls[0] = file:/usr/share/maven2/lib/jsch.jar
> urls[1] = file:/usr/share/maven2/lib/wagon-provider-api.jar
> urls[2] = file:/usr/share/maven2/lib/wagon-file.jar
> urls[3] = file:/usr/share/maven2/lib/doxia-sink-api.jar
> urls[4] = file:/usr/share/maven2/lib/maven2.jar
> urls[5] = file:/usr/share/maven2/lib/plexus-interactivity-api.jar
> urls[6] = file:/usr/share/maven2/lib/wagon-ssh.jar
> urls[7] = file:/usr/share/maven2/lib/wagon-ssh-external.jar
> urls[8] = file:/usr/share/maven2/lib/xml-apis.jar
> urls[9] = file:/usr/share/maven2/lib/plexus-interpolation.jar
> urls[10] = file:/usr/share/maven2/lib/plexus-container-default.jar
> urls[11] = file:/usr/share/maven2/lib/wagon-ssh-common.jar
> urls[12] = file:/usr/share/maven2/lib/wagon-http-shared.jar
> urls[13] = file:/usr/share/maven2/lib/wagon-http-lightweight.jar
> urls[14] = file:/usr/share/maven2/lib/commons-cli.jar
> urls[15] = file:/usr/share/maven2/lib/plexus-utils.jar
> urls[16] = file:/usr/share/maven2/lib/jtidy.jar
> Number of imports: 0
> -----------------------------------------------------
> FATAL ERROR: Unable to read settings.xml Error stacktrace:
> org.codehaus.plexus.component.repository.exception.ComponentLo
> okupException:
> Unable to lookup component 
> 'org.apache.maven.settings.MavenSettingsBuilder',
> it could not be created
>    at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexu
> sContainer.java:335)
>    at org.codehaus.plexus.embed.Embedder.lookup(Embedder.java:78)
>    at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:309)
>    at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
>    at java.lang.reflect.Method.invoke(libgcj.so.90)
>    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.codehaus.plexus.component.factory.ComponentInstantiationEx
> ception: Could not instanciate component: role:
> 'org.apache.maven.settings.MavenSettingsBuilder', implementation:
> 'org.apache.maven.settings.DefaultMavenSettingsBuilder'
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactor
> y.makeException(JavaComponentFactory.java:77)
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactor
> y.newInstance(JavaComponentFactory.java:62)
>    at
> org.codehaus.plexus.DefaultPlexusContainer.createComponentInst
> ance(DefaultPlexusContainer.java:1464)
>    at
> org.codehaus.plexus.component.manager.AbstractComponentManager
> .createComponentInstance(AbstractComponentManager.java:93)
>    at
> org.codehaus.plexus.component.manager.ClassicSingletonComponen
> tManager.getComponent(ClassicSingletonComponentManager.java:92)
>    at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexu
> sContainer.java:331)
>    ...8 more
> Caused by: java.lang.NoClassDefFoundError:
> org.apache.maven.settings.DefaultMavenSettingsBuilder
>    at java.lang.Class.initializeClass(libgcj.so.90)
>    at java.lang.Class.newInstance(libgcj.so.90)
>    at
> org.codehaus.plexus.component.factory.java.JavaComponentFactor
> y.newInstance(JavaComponentFactory.java:44)
>    ...12 more
> Caused by: java.lang.VerifyError: verification failed at PC 63 in
> org.apache.maven.settings.DefaultMavenSettingsBuilder:readSett
> ings((Ljava.io.File;)Lorg.apache.maven.settings.Settings;):
> incompatible type on stack
>    at java.lang.Class.initializeClass(libgcj.so.90)
>    ...14 more
> 
> 
> 
> --
> View this message in context: 
> http://www.nabble.com/FATAL-ERROR%3A-Unable-to-read-settings.x
ml-tp24917137p24917137.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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