Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Source bundles?

Matthias,
It sounds like we face the same situation than you with jetty.
Here is how we do it:

In the root pom:
<build>
  <plugins>
      <!-- source maven plugin creates the source bundle and adds manifest -->
      <plugin>
        <inherited>true</inherited>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>process-classes</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifestEntries>
                  <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
                  <Bundle-Name>${project.name}</Bundle-Name>

<Bundle-SymbolicName>${bundle-symbolic-name}.source;singleton:=true</Bundle-SymbolicName>
                  <Bundle-Vendor>Eclipse.org - Jetty</Bundle-Vendor>
                  <Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>

<Eclipse-SourceBundle>${bundle-symbolic-name};version="${parsedVersion.osgiVersion}";roots:="."</Eclipse-SourceBundle>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Build helper maven plugin sets the
parsedVersion.osgiVersion property -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>set-osgi-version</id>
            <phase>validate</phase>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
(...)

For each one of the jars:
    <properties>
        <bundle-symbolic-name>org.acme.example</bundle-symbolic-name>
    </properties>

If your artifactId matches the symbolic name then you could replace
${bundle-symbolic-name} by ${artifactId} and the whole source-bundle
generation would be defined in the root pom.xml alone.

Cheers,
Hugues


On Wed, Aug 25, 2010 at 1:45 AM, Matthias Sohn
<matthias.sohn@xxxxxxxxxxxxxx> wrote:
> 2010/8/23 Hugues Malphettes <hmalphettes@xxxxxxxxxxx>
>>
>> Hi Chris,
>> You can add to your tycho pom:
>>  <packaging>eclipse-plugin</packaging>
>>  <build>
>>    <plugins>
>>      <plugin>
>>         <groupId>org.sonatype.tycho</groupId>
>>         <artifactId>maven-osgi-source-plugin</artifactId>
>>      </plugin>
>>    </plugins>
>>  </build>
>>
>> Then you will probably need to create a source feature explicitly and
>> refer to it in your site.xml as tycho does not do that just yet
>>
>> http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/eclipse/trunk/jetty-features/org.eclipse.pde.junit.runtime.standalone.source/
>>
>> I hope this helps.
>
> Yeah, thanks that helped : http://egit.eclipse.org/r/#change,1405
> I will try to mimic that for jgit also (that's a bit more tricky since we
> don't use tycho to build the jgit bundle).
> --
> Matthias
>


Back to the top