You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Ken Paulsen (JIRA)" <ji...@apache.org> on 2008/07/16 18:12:31 UTC

[jira] Created: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Bundle-SymbolicName is generated incorrectly
--------------------------------------------

                 Key: FELIX-636
                 URL: https://issues.apache.org/jira/browse/FELIX-636
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-1.4.1
         Environment: Ubuntu
            Reporter: Ken Paulsen


I have the following in the pom.xml:

  <groupId>org.glassfish.jsftemplating</groupId>
  <artifactId>jsftemplating</artifactId>

After I build, I get the following in the MANIFEST.MF:

   Bundle-SymbolicName: org.glassfish.jsftemplating

Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:

  <groupId>org.glassfish.jsftemplating</groupId>
  <artifactId>jsft</artifactId>

I get this in the MANIFEST.MF:

   Bundle-SymbolicName: org.glassfish.jsftemplating.jsft

Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch resolved FELIX-636.
------------------------------------

    Resolution: Fixed

Updated the wiki: http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Maven+Bundle+Plugin+(BND) - changes will appear on the website after an hour or so.

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-1.4.2
>
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Ken Paulsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614047#action_12614047 ] 

Ken Paulsen commented on FELIX-636:
-----------------------------------

Thanks for the clarification!  Your explanation makes sense and describes how it is functioning.

I agree w/ Sahoo, it would be nice if it were documented with the maven-bundle-plugin-bnd.html documentation.

Thanks!

Ken Paulsen

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Ken Paulsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ken Paulsen updated FELIX-636:
------------------------------

    Attachment: pom.xml

This is the pom.xml file which I am using to repackage jsftemplating.  This pom.xml exhibits the problem described in this issue.

Thanks,

Ken Paulsen

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614009#action_12614009 ] 

Stuart McCulloch commented on FELIX-636:
----------------------------------------

This is working as designed - by default we use the Maven2OsgiConverter provided by the Maven team to convert the groupId and artifactId combination to a unique Bundle-SymbolicName, and only fall back to use "groupId.artifactId" as a last resort. This gives us the best compatibility with other Maven plugins that use the same (shared) component:

   http://svn.apache.org/repos/asf/maven/shared/tags/maven-osgi-0.2.0/src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java

The Maven2OsgiConverter component uses the following algorithm to compute the symbolic name:

    /**
     * Get the symbolic name as groupId + "." + artifactId, with the following exceptions
     * <ul>
     * <li>if artifact.getFile is not null and the jar contains a OSGi Manifest with
     * Bundle-SymbolicName property then that value is returned</li>
     * <li>if groupId has only one section (no dots) and artifact.getFile is not null then the
     * first package name with classes is returned. eg. commons-logging:commons-logging ->
     * org.apache.commons.logging</li>
     * <li>if artifactId is equal to last section of groupId then groupId is returned. eg.
     * org.apache.maven:maven -> org.apache.maven</li>
     * <li>if artifactId starts with last section of groupId that portion is removed. eg.
     * org.apache.maven:maven-core -> org.apache.maven.core</li>
     * </ul>
     */

If you want to force the bundleplugin to always use "groupId.artifactId" as the symbolic name then just use:

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.4.1</version>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
            <!-- etc... -->
          </instructions>
        </configuration>
      </plugin>

and this will override the default setting.

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch updated FELIX-636:
-----------------------------------

    Fix Version/s: maven-bundle-plugin-1.4.2

Will update online docs with the current algorithm for determining the symbolic name.

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-1.4.2
>
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch reassigned FELIX-636:
--------------------------------------

    Assignee: Stuart McCulloch

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>            Assignee: Stuart McCulloch
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "Sahoo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614017#action_12614017 ] 

Sahoo commented on FELIX-636:
-----------------------------

It will be good to put this information in the documentation page: http://felix.apache.org/site/maven-bundle-plugin-bnd.html, which currently gives the impression that the default is always ${groupId}.${artifactId}. If we don't want to put too much details, in the main documentation section, then it will be good to just let users know that policy is driven by Maven2OSGiConverter. IMO, this can be converted to a doc bug for this plugin.

> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-636) Bundle-SymbolicName is generated incorrectly

Posted by "luke w patterson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619110#action_12619110 ] 

luke w patterson commented on FELIX-636:
----------------------------------------

One preference is [1]
	Bundle-SymbolicName = ${project.groupId}.${project.artifactId}
and the other is [2]  
	Bundle-SymbolicName = ${project.artifactId}

If (Bundle-SymbolicName = ${project.artifactId}) is preferred, it seems that the conventional configuration for a pom would be:

        <groupId>someGroupId</groupId>
        <artifactId>${project.groupId}.someArtifactId</artifactId>



It is unfortunate that their isn't agreement on a standard convention.

--------------------------------
Here is an example that has caused me problems:

	SWT has gone from 

	<groupId>org.eclipse.swt</groupId> 
	<artifactId>org.eclipse.swt</artifactId> 
	see [3]

to

	<groupId>org.eclipse</groupId> 
	<artifactId>swt</artifactId> 
	see [4]


Now it sounds like it might go to 
	<groupId>org.eclipse</groupId> 
	<artifactId>org.eclipse.swt</artifactId> 


It's hard to managed mixed transitive dependencies, especially when no relocation poms have been deployed.
--------------------------------



Does anyone have any ideas for forming a more unified approach in the community?


[1] - http://jira.codehaus.org/browse/MECLIPSE-238
[2] - http://mail-archives.apache.org/mod_mbox/maven-dev/200805.mbox/%3C69ECB380-90D7-4718-BD2D-A0E22A85B555@maven.org%3E
[3] - versions 3.2.0 and 3.2.1 @ http://repo1.maven.org/eclipse/
[4] - versions 3.3.0-v3339b, 3.3.0-v3345b and 3.3.0-v3346 @http://repo1.maven.org/eclipse/, versions 3.2.1-v3235e and 3.3.0-v3346 @http://repo1.maven.org/maven2/


> Bundle-SymbolicName is generated incorrectly
> --------------------------------------------
>
>                 Key: FELIX-636
>                 URL: https://issues.apache.org/jira/browse/FELIX-636
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>         Environment: Ubuntu
>            Reporter: Ken Paulsen
>         Attachments: pom.xml
>
>
> I have the following in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsftemplating</artifactId>
> After I build, I get the following in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating
> Notice it only has 1 "jsftemplating" in the symbolic name.  If I change the artifactId to something else and make no other changes, I get the expected results.  For example, if I put this in the pom.xml:
>   <groupId>org.glassfish.jsftemplating</groupId>
>   <artifactId>jsft</artifactId>
> I get this in the MANIFEST.MF:
>    Bundle-SymbolicName: org.glassfish.jsftemplating.jsft
> Notice now both the full groupId AND artifact id appear in the symbolic name.  This is what I expected to see. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.