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

Misleading error message if profiles that are active by default do not have an ID

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5
    • 2.0.7
    • Errors
    • None
    • Maven 2.0.x on Mac OSX Java 1.5.0_07 - happens on Java 1.4.2 also

    Description

      to reproduce edit your ~/.m2/settings.xml and add a new profile.
      Mark it as active by default and make sure it has no ID.
      The resulting stack is thus:

      java.lang.ClassCastException: Settings.addActiveProfiles(string) parameter must be instanceof java.lang.String
      at org.apache.maven.settings.Settings.addActiveProfile(Settings.java:91)
      at org.apache.maven.settings.DefaultMavenSettingsBuilder.activateDefaultProfiles(DefaultMavenSettingsBuilder.java:197)
      at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:177)
      at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:153)
      at org.apache.maven.settings.DefaultMavenSettingsBuilder.buildSettings(DefaultMavenSettingsBuilder.java:141)
      at org.apache.maven.cli.MavenCli.buildSettings(MavenCli.java:315)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:176)
      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:585)
      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)

      Attachments

        Activity

          People

            jvanzyl Jason van Zyl
            handyande Andrew Williams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: