[JBoss JIRA] (SHRINKWRAP-379) Add method resolveAsFile to Maven shortcut API
by Samuel Santos (JIRA)
Samuel Santos created SHRINKWRAP-379:
----------------------------------------
Summary: Add method resolveAsFile to Maven shortcut API
Key: SHRINKWRAP-379
URL: https://issues.jboss.org/browse/SHRINKWRAP-379
Project: ShrinkWrap
Issue Type: Enhancement
Components: ext-resolver
Reporter: Samuel Santos
Assignee: Samuel Santos
Currently to create a JavaArchive from an existing file we need something like this:
{code}
final JavaArchive ejbJar = ShrinkWrap
.createFromZipFile(JavaArchive.class, DependencyResolvers.use(MavenDependencyResolver.class)
.loadMetadataFromPom("pom.xml").artifact("com.foo:bar")
.resolveAsFiles(new StrictFilter())[0]);
{code}
Would be cleaner to use the Maven Shortcut API:
{code}
final JavaArchive ejbJar = ShrinkWrap
.createFromZipFile(JavaArchive.class, Maven.withPom("pom.xml").dependency("com.foo:bar").resolveAsFile());
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (SHRINKWRAP-372) create a way to LibraryContainer#assAsLibrary by a given marker file
by Mark Struberg (Created) (JIRA)
create a way to LibraryContainer#assAsLibrary by a given marker file
--------------------------------------------------------------------
Key: SHRINKWRAP-372
URL: https://issues.jboss.org/browse/SHRINKWRAP-372
Project: ShrinkWrap
Issue Type: Enhancement
Reporter: Mark Struberg
When working with CDI Extensions we need to 'package' a whole JAR (or it's whole content) into a JavaArchive which can be used for addAsLibrary based on the marker file "/META-INF/beans.xml".
This is needed as we cannot simply addAsPackage because the extension jar files would each overwrite other beans.xml files.
Something like
LibraryContainer#addContainingLibraries(String markerResource);
LibraryContainer#addContainingLibraries(String markerResource, String packageNameInclude, String packageNameExclude);
Example:
ShrinkWrap.create(WebArchive.class, "test.jar").addContainingLibraries("/META-INF/beans.xml");
would package all JARs which have a resource "/META-INF/beans.xml", pack them into JavaArchives and add those to the WebArchive.
With packageNameInclude and packageNameExclude we could add rules about which jars to add and exclude.
But I'm sure there is already an established pattern for such a thing in ShrinkWrap.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months