Hi,
this is a working approach for us:
We assume that source archives are packaged as either zip or jar
in a folder "lib-src" (${lib.src.folder}) located beneath the
bundle root. If such a folder exists, a profile gets activated:
- The source archives are unzipped into a surrogate "srcroot"
(${src.root.folder}) folder by an ANT script.
- The standard source bundle plugin settings are extended to
include this surrogate folder as additional sources.
Then you will get a ordinary source bundle which looks and feels
just like your own source bundles.
Hints: You need to make sure that the source archive contains the
sources at the archive's root level, i.e. the package folders need
to start at root. I had to manually change some archives to adhere
to this structure.
Also, the below definition excludes archives with an "all" part
which are often containing a lot of non-source-related files.
Hope this helps.
Kind regards
Henrik
Maven Parent POM:
<properties>
<!--folder name to extract ext sources from -->
<lib.src.folder>lib-src</lib.src.folder>
<src.root.folder>srcroot</src.root.folder>
</properties>
<profile>
<id>unzip-src</id>
<activation>
<file>
<exists>${lib.src.folder}</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<failOnError>true</failOnError>
<target>
<echo
message="Preparing source bundle creation for plugin." />
<unzip
dest="${basedir}/${src.root.folder}" overwrite="false">
<fileset
dir="${basedir}/${lib.src.folder}">
<include
name="**/*.jar" />
<include
name="**/*.zip" />
<exclude
name="**/*javadoc*" />
<!--a 'all'
part in archive name indicates that this archive contains more
than sources, e.g. testdata, compiled binaries. -->
<exclude
name="**/*all*" />
</fileset>
</unzip>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<additionalFileSets>
<fileSet>
<directory>${project.basedir}/${src.root.folder}/</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</additionalFileSets>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Am 09.08.2017 um 16:51 schrieb Andreas Pakulat: