You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Don Laidlaw (JIRA)" <ji...@codehaus.org> on 2009/03/18 21:01:12 UTC

[jira] Created: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Generate source jars supporting Eclipse Source Bundle format.
-------------------------------------------------------------

                 Key: MSOURCES-41
                 URL: http://jira.codehaus.org/browse/MSOURCES-41
             Project: Maven 2.x Source Plugin
          Issue Type: New Feature
    Affects Versions: 2.0.4
         Environment: Eclipse 3.3+
            Reporter: Don Laidlaw


When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles

A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.

It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.

I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172664#action_172664 ] 

Paul Gier commented on MSOURCES-41:
-----------------------------------

Don, does MSOURCES-42 work for you to resolve this?  If not, can you attach a patch for this?  Then I can apply it for you.

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173553#action_173553 ] 

Don Laidlaw commented on MSOURCES-41:
-------------------------------------

MSOURCES-42 almost does the trick. This type of thing works:

{code}<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-source-plugin</artifactId>
	<version>2.1-SNAPSHOT</version>
	<executions>
		<execution>
			<id>attach-sources</id>
			<phase>verify</phase>
			<goals>
				<goal>jar</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<archive>
			<manifestEntries>
				<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
				<Bundle-Name>${name}</Bundle-Name>
				<Bundle-SymbolicName>${artifactId}.source</Bundle-SymbolicName>
				<Bundle-Vendor>${organization.name}</Bundle-Vendor>
				<Bundle-Version>1.0.0.SNAPSHOT</Bundle-Version>
				<Eclipse-SourceBundle>${artifactId};version="1.0.0.SNAPSHOT";roots:="."</Eclipse-SourceBundle>
			</manifestEntries>
		</archive>
	</configuration>
</plugin>
{code}

There is only one problem really. When we create OSGi bundle jars the maven-bundle-plugin automatically converts the maven pom version into an OSGi-compatible version. For instance: 1.0.0-SNAPSHOT becomes 1.0.0.SNAPSHOT. In general the bundle plugin replaces the '-' character with a dot.

When generating the manifest for the Eclipse source bundle, the version must match. It would be extremely convenient to generate the version in exactly the same way as the maven bundle plugin (by replacing the '-' with '.') so that the configuration for the source bundle generation could be parameterized. That way a parent project could specify the format for all the child projects.

So while it is possible to just specify the version number directly in the manifest settings as above, it would be a real pain to keep that in sync with the pom version. 

Any thoughts on how to accomplish this??

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=172767#action_172767 ] 

Don Laidlaw commented on MSOURCES-41:
-------------------------------------

MSOURCES-42 seems to have great potential for this. I will play with it and see if I can get it to meet the needs of an Eclipse source bundle. If not, I will provide a patch. Thanks!

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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] Closed: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Laidlaw closed MSOURCES-41.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1

With the inclusion of the <archive> configuration parameter in 2.1, combined with the plugin I wrote in response to MNG-4105 there is a complete solution for this problem. See MNG-4105 for a sample of how this was solved.

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>             Fix For: 2.1
>
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173554#action_173554 ] 

Don Laidlaw commented on MSOURCES-41:
-------------------------------------

MSOURCES-42 almost does the trick. This type of thing works:

{code}<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-source-plugin</artifactId>
	<version>2.1-SNAPSHOT</version>
	<executions>
		<execution>
			<id>attach-sources</id>
			<phase>verify</phase>
			<goals>
				<goal>jar</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<archive>
			<manifestEntries>
				<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
				<Bundle-Name>${name}</Bundle-Name>
				<Bundle-SymbolicName>${artifactId}.source</Bundle-SymbolicName>
				<Bundle-Vendor>${organization.name}</Bundle-Vendor>
				<Bundle-Version>1.0.0.SNAPSHOT</Bundle-Version>
				<Eclipse-SourceBundle>${artifactId};version="1.0.0.SNAPSHOT";roots:="."</Eclipse-SourceBundle>
			</manifestEntries>
		</archive>
	</configuration>
</plugin>
{code}

There is only one problem really. When we create OSGi bundle jars the maven-bundle-plugin automatically converts the maven pom version into an OSGi-compatible version. For instance: 1.0.0-SNAPSHOT becomes 1.0.0.SNAPSHOT. In general the bundle plugin replaces the '-' character with a dot.

When generating the manifest for the Eclipse source bundle, the version must match. It would be extremely convenient to generate the version in exactly the same way as the maven bundle plugin (by replacing the '-' with '.') so that the configuration for the source bundle generation could be parameterized. That way a parent project could specify the format for all the child projects.

So while it is possible to just specify the version number directly in the manifest settings as above, it would be a real pain to keep that in sync with the pom version. 

Any thoughts on how to accomplish this??

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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] Issue Comment Edited: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Don Laidlaw (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=173554#action_173554 ] 

Don Laidlaw edited comment on MSOURCES-41 at 4/20/09 1:26 PM:
--------------------------------------------------------------

Sorry, was a fat fingered dup of the previous.

      was (Author: dlaidlaw):
    MSOURCES-42 almost does the trick. This type of thing works:

{code}<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-source-plugin</artifactId>
	<version>2.1-SNAPSHOT</version>
	<executions>
		<execution>
			<id>attach-sources</id>
			<phase>verify</phase>
			<goals>
				<goal>jar</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<archive>
			<manifestEntries>
				<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
				<Bundle-Name>${name}</Bundle-Name>
				<Bundle-SymbolicName>${artifactId}.source</Bundle-SymbolicName>
				<Bundle-Vendor>${organization.name}</Bundle-Vendor>
				<Bundle-Version>1.0.0.SNAPSHOT</Bundle-Version>
				<Eclipse-SourceBundle>${artifactId};version="1.0.0.SNAPSHOT";roots:="."</Eclipse-SourceBundle>
			</manifestEntries>
		</archive>
	</configuration>
</plugin>
{code}

There is only one problem really. When we create OSGi bundle jars the maven-bundle-plugin automatically converts the maven pom version into an OSGi-compatible version. For instance: 1.0.0-SNAPSHOT becomes 1.0.0.SNAPSHOT. In general the bundle plugin replaces the '-' character with a dot.

When generating the manifest for the Eclipse source bundle, the version must match. It would be extremely convenient to generate the version in exactly the same way as the maven bundle plugin (by replacing the '-' with '.') so that the configuration for the source bundle generation could be parameterized. That way a parent project could specify the format for all the child projects.

So while it is possible to just specify the version number directly in the manifest settings as above, it would be a real pain to keep that in sync with the pom version. 

Any thoughts on how to accomplish this??
  
> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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: (MSOURCES-41) Generate source jars supporting Eclipse Source Bundle format.

Posted by "Harald Wellmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSOURCES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=170535#action_170535 ] 

Harald Wellmann commented on MSOURCES-41:
-----------------------------------------

Yes, I would definitely like to see this feature in standard Maven. I implemented my own mojo for this in https://svn.berlios.de/svnroot/repos/datascript/trunk/maven-sourcebundle-plugin/.

> Generate source jars supporting Eclipse Source Bundle format.
> -------------------------------------------------------------
>
>                 Key: MSOURCES-41
>                 URL: http://jira.codehaus.org/browse/MSOURCES-41
>             Project: Maven 2.x Source Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.0.4
>         Environment: Eclipse 3.3+
>            Reporter: Don Laidlaw
>
> When developing eclipse plugins, or any OSGi bundle, it is desirable to create the source attachments for a project as Eclipse Source Bundles. See http://wiki.eclipse.org/Source_Bundles
> A source bundle appears in the target platform (the bundles in the runtime) and allows the user to step into the source in debug, view the source, and see the javadoc from the source. All without having to download the source project. Source bundles differ from source attachments in non OSGi projects in that they are part of the target platform, which is resolved dynamically at runtime, not at compile time with the classpath.
> It is very easy to extend the maven source plugin to create these source bundles. They are identical to the currently generated jar, with the addition of a few entries in the META-INF/MANIFEST.MF file. So source jars usable as source bundles are also 100% compatible with what is currently generated.
> I have already done the work and would be happy to contribute this back if there is any interest.

-- 
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