You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "charles prevot (JIRA)" <ji...@codehaus.org> on 2008/07/21 09:59:26 UTC
[jira] Created: (MECLIPSE-467) problem with the way the _ and - get
transformed
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
[jira] Commented: (MECLIPSE-467) problem with the way the _ and -
get transformed
Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=142657#action_142657 ]
Arnaud Heritier commented on MECLIPSE-467:
------------------------------------------
Maven standards are to have '-' between the name of the artifact and its release.
That's why the to-maven goal change it.
The problem I think is in the install-plugins goal.
> 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
[jira] Commented: (MECLIPSE-467) problem with the way the _ and -
get transformed
Posted by "charles prevot (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MECLIPSE-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=142705#action_142705 ]
charles prevot commented on MECLIPSE-467:
-----------------------------------------
Just to make sure we're talking about the same thing, the problem I had was not the char between the name of the artifact and its release, but was in a '-' inside the name of the qualifier version.
For exemple, with group artifact 3.4.0 and qualifier, from eclipse to maven to eclipse:
group.artifact.3.4.0_qualifier.jar => group.arftifact.3.4.0-qualifier.jar => group.artifact.3.4.0_qualifier.jar (OK)
with group artifact 3.4.0 and 'qualifier-with-dashes'
group.artifact.3.4.0_qualifier-with-dashes.jar => group.arftifact.3.4.0-qualifier_with_dashes.jar => group.artifact.3.4.0_qualifier_with_dashes.jar (KO)
I think the problem comes from the regexp in DefaultMaven2OsgiConverter: there should be no character replacement in the qualifier part of the version.
> 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