Hi, I am currently in the process of packaging Maven 3 and all its dependencies for Fedora. I encountered few things in org.sonatype.sisu pom.xml that I don't entirely understand.
This is the main directory structure:
.
├── guice-bean
│ ├── guice-bean-binders
│ ├── guice-bean-containers
│ ├── guice-bean-converters
│ ├── guice-bean-inject
│ ├── guice-bean-locators
│ ├── guice-bean-reflect
│ ├── guice-bean-scanners
│ └── sisu-inject-bean
└── guice-plexus
├── guice-plexus-binders
├── guice-plexus-converters
├── guice-plexus-locators
├── guice-plexus-metadata
├── guice-plexus-scanners
├── guice-plexus-shim
└── sisu-inject-plexus
sisu-inject-bean and sisu-inject plexus seem to be bundling and shading
rest of their group respectively (plus few other libraries such as
objectweb-asm, javax.inject and some plexus parts).
What I don't understand is why was this approach used instead of
standard dependency resolution of maven (addding libraries into
<dependency> section or similar). For the reference I am adding part of
sisu-inject-plexus pom.xml containing settings for bundle and shade
plugin. I am guessing it might have something to do with the way bundle
plugin is used, but I'd rather know for sure.
-------------
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<excludeDependencies>
<!-- fragment host and external dependencies -->
sisu-inject-bean,*;groupId=org.codehaus.plexus
</excludeDependencies>
<instructions>
<Bundle-SymbolicName>
org.sonatype.inject.plexus
</Bundle-SymbolicName>
<Fragment-Host>
org.sonatype.inject
</Fragment-Host>
<Export-Package>
org.codehaus.plexus.*;-noimport:=true;-split-package:=merge-first
</Export-Package>
<Private-Package>
META-INF.plexus,org.sonatype.guice.*,org.objectweb.asm
</Private-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${project.groupId}:${project.artifactId}</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.objectweb</pattern>
<shadedPattern>org.sonatype.guice</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<includes>
<include>META-INF/**</include>
<include>org/codehaus/plexus/**</include>
<include>org/sonatype/guice/plexus/**</include>
<include>org/objectweb/asm/*Writer*</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
----------------
--
Stanislav Ochotnicky <[email protected]>
Associate Software Engineer - Base Operating Systems Brno
PGP: 71A1677C
Red Hat Inc. http://cz.redhat.com
signature.asc
Description: OpenPGP digital signature
