On 11 October 2010 09:15, Stanislav Ochotnicky <[email protected]>wrote:
> 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. > you already asked this question: http://maven.40175.n5.nabble.com/Explanation-for-bundle-shade-of-org-sonatype-sisu-td3204579.html and received an answer: http://maven.40175.n5.nabble.com/Re-Explanation-for-bundle-shade-of-org-sonatype-sisu-td3204596.html it's basically an assembly of the smaller component jars into a cohesive bundle > 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 > > -- Cheers, Stuart
