Maven 2 & 3

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

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.5
  • Fix Version/s: 2.0.7
  • Component/s: Errors
  • Labels:
    None
  • Environment:
    Maven 2.0.x on Mac OSX Java 1.5.0_07 - happens on Java 1.4.2 also
  • Complexity:
    Intermediate
  • Number of attachments :
    0

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)

Activity

Hide
Andrew Williams added a comment -

It seems that this is somehow due to the <id> field which should be required not being verified when the ~/.m2/settings.xml is merged into the effective-pom.

Show
Andrew Williams added a comment - It seems that this is somehow due to the <id> field which should be required not being verified when the ~/.m2/settings.xml is merged into the effective-pom.
Hide
Jason van Zyl added a comment -

Fixed in trunk and the branch.

Show
Jason van Zyl added a comment - Fixed in trunk and the branch.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: