You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Simon Goodall <si...@minimaxlabs.com> on 2011/10/31 11:59:48 UTC

Generating Source bundles for eclipse

I am trying to generate a source bundle for use in eclipse. This
requires the source bundle to have specific manifest entries. I can
manually add these using the standard jar manifest properties in my
pom. However I need the symbolic name and the bundle osgi version. Is
there a way to hook the maven bundle plugin into the source jar
creation - or is it possible to expose this information as properties
which can be accessed in the pom?

Regards,

Simon

-- 
Simon Goodall

Minimax Labs Ltd, a company registered in England and Wales,
registration number 07193685, registered office: Office 4, 219
Kensington High Street, London  W8 6BD. This message may contain
privileged or confidential information. If you are not the intended
recipient, please delete it and inform the sender immediately. Any
unauthorised use of any of the information contained in this email is
strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Generating Source bundles for eclipse

Posted by Simon Goodall <si...@minimaxlabs.com>.
On 8 November 2011 13:58, Stuart McCulloch <mc...@gmail.com> wrote:
> On 8 Nov 2011, at 13:43, Simon Goodall wrote:
>
>> Hi,
>>
>> I tried adding <_sources> (and a <_sourcepath>) to my <instructions>
>> section of my pom.xml and also to a bnd.bnd file with <_include>.
>> Under the bundle plugin version 2.3.5 nothing appears to happen. Under
>> 2.4.0-SNAPSHOT I get a class cast exception.
>>
>> From the description it appears that the sources will appear inside
>> the same bundle. I am trying to create a separate source bundle.
>
> If you're using Maven then just use the maven-source-plugin:
>
>      <plugin>
>        <artifactId>maven-source-plugin</artifactId>
>        <version>2.1.2</version>
>        <executions>
>          <execution>
>            <id>attach-sources</id>
>            <goals>
>              <goal>jar-no-fork</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
> The source jar doesn't have to have specific manifest entries if you use m2e to import your project, but if you need to add them use an archive element inside the source plugin configuration:
>
>   http://maven.apache.org/shared/maven-archiver/index.html
>
> So if you wanted it to contain the same manifest as your main bundle, you could use:
>
>      <plugin>
>        <artifactId>maven-source-plugin</artifactId>
>        <version>2.1.2</version>
>        <configuration>
>          <archive>
>            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
>          </archive>
>        </configuration>
>        <executions>
>          <execution>
>            <id>attach-sources</id>
>            <goals>
>              <goal>jar-no-fork</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
> Or alternatively use one of the other archive settings to add specific manifest entries.
>

This is currently how I am doing it to add the Eclipse-SouceBundle
header. However this requires access to the osgi bundle name and
version string.

Simon

>> Thanks,
>>
>> Simon
>>
>> On 31 October 2011 13:11, Peter Kriens <pe...@aqute.biz> wrote:
>>> Just put -sources in the bnd file. This will put your sources in the JAR at OSGI-INF, eclipse will recognize this.
>>>
>>> Peter Kriens
>>>
>>> -----
>>> Sent while on the road, mobile +33698332260
>>>
>>>
>>> Op 31 okt. 2011 om 11:59 heeft Simon Goodall <si...@minimaxlabs.com> het volgende geschreven:
>>>
>>>> I am trying to generate a source bundle for use in eclipse. This
>>>> requires the source bundle to have specific manifest entries. I can
>>>> manually add these using the standard jar manifest properties in my
>>>> pom. However I need the symbolic name and the bundle osgi version. Is
>>>> there a way to hook the maven bundle plugin into the source jar
>>>> creation - or is it possible to expose this information as properties
>>>> which can be accessed in the pom?
>>>>
>>>> Regards,
>>>>
>>>> Simon
>>>>
>>>> --
>>>> Simon Goodall
>>>>
>>>> Minimax Labs Ltd, a company registered in England and Wales,
>>>> registration number 07193685, registered office: Office 4, 219
>>>> Kensington High Street, London  W8 6BD. This message may contain
>>>> privileged or confidential information. If you are not the intended
>>>> recipient, please delete it and inform the sender immediately. Any
>>>> unauthorised use of any of the information contained in this email is
>>>> strictly prohibited.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Simon Goodall, PhD
>> Solutions Architect
>> Minimax Labs Ltd, 31 Southampton Row, London WC1B 5HJ, UK
>> t/f: +44 (0)20 3356 9771 | m: 07905 266 385
>> e: simon.goodall@minimaxlabs.com
>> www.minimaxlabs.com
>>
>> Minimax Labs Ltd, a company registered in England and Wales,
>> registration number 07193685, registered office: Office 4, 219
>> Kensington High Street, London  W8 6BD. This message may contain
>> privileged or confidential information. If you are not the intended
>> recipient, please delete it and inform the sender immediately. Any
>> unauthorised use of any of the information contained in this email is
>> strictly prohibited.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Simon Goodall, PhD
Solutions Architect
Minimax Labs Ltd, 31 Southampton Row, London WC1B 5HJ, UK
t/f: +44 (0)20 3356 9771 | m: 07905 266 385
e: simon.goodall@minimaxlabs.com
www.minimaxlabs.com

Minimax Labs Ltd, a company registered in England and Wales,
registration number 07193685, registered office: Office 4, 219
Kensington High Street, London  W8 6BD. This message may contain
privileged or confidential information. If you are not the intended
recipient, please delete it and inform the sender immediately. Any
unauthorised use of any of the information contained in this email is
strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Generating Source bundles for eclipse

Posted by Stuart McCulloch <mc...@gmail.com>.
On 8 Nov 2011, at 13:43, Simon Goodall wrote:

> Hi,
> 
> I tried adding <_sources> (and a <_sourcepath>) to my <instructions>
> section of my pom.xml and also to a bnd.bnd file with <_include>.
> Under the bundle plugin version 2.3.5 nothing appears to happen. Under
> 2.4.0-SNAPSHOT I get a class cast exception.
> 
> From the description it appears that the sources will appear inside
> the same bundle. I am trying to create a separate source bundle.

If you're using Maven then just use the maven-source-plugin:

      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

The source jar doesn't have to have specific manifest entries if you use m2e to import your project, but if you need to add them use an archive element inside the source plugin configuration:

   http://maven.apache.org/shared/maven-archiver/index.html

So if you wanted it to contain the same manifest as your main bundle, you could use:

      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Or alternatively use one of the other archive settings to add specific manifest entries.

> Thanks,
> 
> Simon
> 
> On 31 October 2011 13:11, Peter Kriens <pe...@aqute.biz> wrote:
>> Just put -sources in the bnd file. This will put your sources in the JAR at OSGI-INF, eclipse will recognize this.
>> 
>> Peter Kriens
>> 
>> -----
>> Sent while on the road, mobile +33698332260
>> 
>> 
>> Op 31 okt. 2011 om 11:59 heeft Simon Goodall <si...@minimaxlabs.com> het volgende geschreven:
>> 
>>> I am trying to generate a source bundle for use in eclipse. This
>>> requires the source bundle to have specific manifest entries. I can
>>> manually add these using the standard jar manifest properties in my
>>> pom. However I need the symbolic name and the bundle osgi version. Is
>>> there a way to hook the maven bundle plugin into the source jar
>>> creation - or is it possible to expose this information as properties
>>> which can be accessed in the pom?
>>> 
>>> Regards,
>>> 
>>> Simon
>>> 
>>> --
>>> Simon Goodall
>>> 
>>> Minimax Labs Ltd, a company registered in England and Wales,
>>> registration number 07193685, registered office: Office 4, 219
>>> Kensington High Street, London  W8 6BD. This message may contain
>>> privileged or confidential information. If you are not the intended
>>> recipient, please delete it and inform the sender immediately. Any
>>> unauthorised use of any of the information contained in this email is
>>> strictly prohibited.
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> 
> 
> -- 
> Simon Goodall, PhD
> Solutions Architect
> Minimax Labs Ltd, 31 Southampton Row, London WC1B 5HJ, UK
> t/f: +44 (0)20 3356 9771 | m: 07905 266 385
> e: simon.goodall@minimaxlabs.com
> www.minimaxlabs.com
> 
> Minimax Labs Ltd, a company registered in England and Wales,
> registration number 07193685, registered office: Office 4, 219
> Kensington High Street, London  W8 6BD. This message may contain
> privileged or confidential information. If you are not the intended
> recipient, please delete it and inform the sender immediately. Any
> unauthorised use of any of the information contained in this email is
> strictly prohibited.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Generating Source bundles for eclipse

Posted by Simon Goodall <si...@minimaxlabs.com>.
Hi,

I tried adding <_sources> (and a <_sourcepath>) to my <instructions>
section of my pom.xml and also to a bnd.bnd file with <_include>.
Under the bundle plugin version 2.3.5 nothing appears to happen. Under
2.4.0-SNAPSHOT I get a class cast exception.

>From the description it appears that the sources will appear inside
the same bundle. I am trying to create a separate source bundle.

Thanks,

Simon

On 31 October 2011 13:11, Peter Kriens <pe...@aqute.biz> wrote:
> Just put -sources in the bnd file. This will put your sources in the JAR at OSGI-INF, eclipse will recognize this.
>
> Peter Kriens
>
> -----
> Sent while on the road, mobile +33698332260
>
>
> Op 31 okt. 2011 om 11:59 heeft Simon Goodall <si...@minimaxlabs.com> het volgende geschreven:
>
>> I am trying to generate a source bundle for use in eclipse. This
>> requires the source bundle to have specific manifest entries. I can
>> manually add these using the standard jar manifest properties in my
>> pom. However I need the symbolic name and the bundle osgi version. Is
>> there a way to hook the maven bundle plugin into the source jar
>> creation - or is it possible to expose this information as properties
>> which can be accessed in the pom?
>>
>> Regards,
>>
>> Simon
>>
>> --
>> Simon Goodall
>>
>> Minimax Labs Ltd, a company registered in England and Wales,
>> registration number 07193685, registered office: Office 4, 219
>> Kensington High Street, London  W8 6BD. This message may contain
>> privileged or confidential information. If you are not the intended
>> recipient, please delete it and inform the sender immediately. Any
>> unauthorised use of any of the information contained in this email is
>> strictly prohibited.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Simon Goodall, PhD
Solutions Architect
Minimax Labs Ltd, 31 Southampton Row, London WC1B 5HJ, UK
t/f: +44 (0)20 3356 9771 | m: 07905 266 385
e: simon.goodall@minimaxlabs.com
www.minimaxlabs.com

Minimax Labs Ltd, a company registered in England and Wales,
registration number 07193685, registered office: Office 4, 219
Kensington High Street, London  W8 6BD. This message may contain
privileged or confidential information. If you are not the intended
recipient, please delete it and inform the sender immediately. Any
unauthorised use of any of the information contained in this email is
strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Generating Source bundles for eclipse

Posted by Peter Kriens <pe...@aqute.biz>.
Just put -sources in the bnd file. This will put your sources in the JAR at OSGI-INF, eclipse will recognize this.

Peter Kriens

-----
Sent while on the road, mobile +33698332260


Op 31 okt. 2011 om 11:59 heeft Simon Goodall <si...@minimaxlabs.com> het volgende geschreven:

> I am trying to generate a source bundle for use in eclipse. This
> requires the source bundle to have specific manifest entries. I can
> manually add these using the standard jar manifest properties in my
> pom. However I need the symbolic name and the bundle osgi version. Is
> there a way to hook the maven bundle plugin into the source jar
> creation - or is it possible to expose this information as properties
> which can be accessed in the pom?
> 
> Regards,
> 
> Simon
> 
> -- 
> Simon Goodall
> 
> Minimax Labs Ltd, a company registered in England and Wales,
> registration number 07193685, registered office: Office 4, 219
> Kensington High Street, London  W8 6BD. This message may contain
> privileged or confidential information. If you are not the intended
> recipient, please delete it and inform the sender immediately. Any
> unauthorised use of any of the information contained in this email is
> strictly prohibited.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org