Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-3701

ClassCastException when building settings.xml with profiles that have activeByDefault set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.10
    • 2.0.11, 2.1.0-M1
    • Settings
    • None

    Description

      from Paul Benedict:

      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)
      

      Then, in a later message:

      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
      

      Attachments

        Activity

          People

            jdcasey John Dennis Casey
            jdcasey John Dennis Casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: