You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephen Denne (JIRA)" <ji...@codehaus.org> on 2009/02/19 22:30:19 UTC

[jira] Commented: (MNG-3701) ClassCastException when building settings.xml with profiles that have activeByDefault set

    [ http://jira.codehaus.org/browse/MNG-3701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=166295#action_166295 ] 

Stephen Denne commented on MNG-3701:
------------------------------------

I just installed 2.0.10 release version, and my first use had the same symptoms as this issue. I can work around it by adding an id element (with any value) to the single profile I had defined.

> ClassCastException when building settings.xml with profiles that have activeByDefault set
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-3701
>                 URL: http://jira.codehaus.org/browse/MNG-3701
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Settings
>    Affects Versions: 2.0.10
>            Reporter: John Casey
>            Assignee: John Casey
>            Priority: Blocker
>             Fix For: 2.0.10, 2.1.0-M1
>
>
> from Paul Benedict:
> {noformat}
> I tried RC5 and got this weird error.
> > >c:\dev\apache-maven-2.0.10-RC5\bin\mvn.bat site:deploy
> ---------------------------------------------------
> constituent[0]:
> file:/c:/Dev/apache-maven-2.0.10-RC5/bin/../lib/maven-2.0.10-RC5-uber.jar
> ---------------------------------------------------
> java.lang.ClassCastException: Settings.addActiveProfiles(string)
> parameter must be instanceof java.lang.String
>         at org.apache.maven.settings.Settings.addActiveProfile(Settings.java:112)
>         at org.apache.maven.settings.DefaultMavenSettingsBuilder.activateDefaultProfiles(DefaultMavenSettingsBuilder.jav
> a:198)
>         at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:178)
>         at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:154)
>         at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:142)
>         at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:345)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:201)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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)
> {noformat}
> Then, in a later message:
> {noformat}
> When I reinstalled 2.0.10-RC5, it ran fine. Then I realized my
> reinstall didn't include my custom settings.xml, but once I put that
> back into /conf, everything went bonkers again. So that's where the
> problem is.
> You can reproduce the problem by doing the following:
> - Edit the original settings.xml that comes with Maven
> - Within <profiles>, add this:
> <profile>
>   <activation>
>     <activeByDefault>true</activeByDefault>
>   </activation>
> </profile>
> The exception from my previous email should then be given:
> java.lang.ClassCastException: Settings.addActiveProfiles(string)
> parameter must be instanceof java.lang.String
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira