Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-850

Wrong symbolic name computed when groupId is a single segment string.

    Details

      Description

      According to the documentation, a bundles symbolic name should follow respect the following:

      • if artifactId starts with last section of groupId that portion is removed. eg. org.apache.maven:maven-core -> org.apache.maven.core

      however, when the groupId a single segment, this rule is ignored. Thus a groupId of smx3 and artifactId of smx3.testing gets a symbolic name of smx3.smx3.testing. When it should just be smx3.testing.

        Activity

        Hide
        mcculls Stuart McCulloch added a comment -

        Closing as maven-bundle-plugin 2.0.0 has been released.

        Show
        mcculls Stuart McCulloch added a comment - Closing as maven-bundle-plugin 2.0.0 has been released.
        Hide
        mcculls Stuart McCulloch added a comment -

        I've fixed this locally in trunk (see r738941) the actual patch is as follows:

        Index: src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java
        ===================================================================
        — src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (revision 738817)
        +++ src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (working copy)
        @@ -78,7 +78,7 @@
        */
        public String getBundleSymbolicName( Artifact artifact )
        {

        • if ( ( artifact.getFile() != null ) && artifact.getFile().exists() )
          + if ( ( artifact.getFile() != null ) && artifact.getFile().isFile() ) { Analyzer analyzer = new Analyzer(); @@ -121,7 +121,7 @@ }

        int i = artifact.getGroupId().lastIndexOf( '.' );

        • if ( ( i < 0 ) && ( artifact.getFile() != null ) && artifact.getFile().exists() )
          + if ( ( i < 0 ) && ( artifact.getFile() != null ) && artifact.getFile().isFile() )
          {
          String groupIdFromPackage = getGroupIdFromPackage( artifact.getFile() );
          if ( groupIdFromPackage != null )
        Show
        mcculls Stuart McCulloch added a comment - I've fixed this locally in trunk (see r738941) the actual patch is as follows: Index: src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java =================================================================== — src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (revision 738817) +++ src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java (working copy) @@ -78,7 +78,7 @@ */ public String getBundleSymbolicName( Artifact artifact ) { if ( ( artifact.getFile() != null ) && artifact.getFile().exists() ) + if ( ( artifact.getFile() != null ) && artifact.getFile().isFile() ) { Analyzer analyzer = new Analyzer(); @@ -121,7 +121,7 @@ } int i = artifact.getGroupId().lastIndexOf( '.' ); if ( ( i < 0 ) && ( artifact.getFile() != null ) && artifact.getFile().exists() ) + if ( ( i < 0 ) && ( artifact.getFile() != null ) && artifact.getFile().isFile() ) { String groupIdFromPackage = getGroupIdFromPackage( artifact.getFile() ); if ( groupIdFromPackage != null )
        Hide
        mcculls Stuart McCulloch added a comment -

        We currently use the shared maven OSGi component (http://jira.codehaus.org/browse/MSHARED/component/13273) to compact the bundle symbolic name, so we'll either need to raise the request there or fix it locally. I'll probably end up doing both to avoid further delay of the next bundleplugin release (the shared component seems to have a slow release cycle - see http://jira.codehaus.org/browse/MSHARED-53).

        Show
        mcculls Stuart McCulloch added a comment - We currently use the shared maven OSGi component ( http://jira.codehaus.org/browse/MSHARED/component/13273 ) to compact the bundle symbolic name, so we'll either need to raise the request there or fix it locally. I'll probably end up doing both to avoid further delay of the next bundleplugin release (the shared component seems to have a slow release cycle - see http://jira.codehaus.org/browse/MSHARED-53 ).

          People

          • Assignee:
            mcculls Stuart McCulloch
            Reporter:
            talios Mark Derricutt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development