problem with the way the _ and - get transformed ------------------------------------------------
Key: MECLIPSE-467 URL: http://jira.codehaus.org/browse/MECLIPSE-467 Project: Maven 2.x Eclipse Plugin Issue Type: Bug Components: OSGi, Manifest Reporter: charles prevot Priority: Critical I am having some troubles building an RCP application with maven. I had to modify DefaultMaven2OsgiConverter. Here is a brief explanation of my problem: * I have {{org.eclipse.core.commands_3.4.0.I20080509-2000.jar}} in my {{eclipse/plugins}} directory * After a {{mvn eclipse:to-maven}}, I have {{org/eclipse/core/commands/3.4.0-I20080509-2000/commands-3.4.0-I20080509-2000.jar}} in my repository. *Then I try to build a target platform against which I would build my application, so I run {{mvn eclipse:install-plugins}} and it generates me a {{org.eclipse.core.commands_3.4.0.I20080509_2000.jar}} (notice the {{_}} instead of the {{-}} in the qualifier part) . Doing {{mvn eclipse:to-maven}} followed by {{mvn eclipse :install-plugins}} should end up with the same jar names. I modfied DefaultMaven2OsgiConverter.java to remove the conversions. Though it is definitely not a fix, here is the patch: {noformat}Index: src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java =================================================================== --- src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (revision 677553) +++ src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (working copy) @@ -257,7 +257,8 @@ String major = m.group( 1 ); String minor = ( m.group( 3 ) != null ) ? m.group( 3 ) : "0"; String service = ( m.group( 5 ) != null ) ? m.group( 5 ) : "0"; - String qualifier = m.group( 6 ).replaceAll( "-", "_" ).replaceAll( "\\.", "_" ); + String qualifier = m.group( 6 ); + //String qualifier = m.group( 6 ).replaceAll( "-", "_" ).replaceAll( "\\.", "_" ); osgiVersion = major + "." + minor + "." + service + "." + qualifier; } @@ -263,7 +264,7 @@ /* else transform first - to . and others to _ */ osgiVersion = osgiVersion.replaceFirst( "-", "\\." ); - osgiVersion = osgiVersion.replaceAll( "-", "_" ); + //osgiVersion = osgiVersion.replaceAll( "-", "_" ); m = OSGI_VERSION_PATTERN.matcher( osgiVersion ); if ( m.matches() ) { {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