-
1. Re: How to obtain an archive from a maven repo?
aslak Mar 26, 2011 7:04 AM (in response to juergen.zimmermann)resolve will resolve all the dependencies of the Artifact as well, and you can add them directly to the Archive. e.g.
WebArchive war = ShrinkWrap.create(WebArchive.class).addAsLibraries( DependencyResolvers.use(MavenDependencyResolver.class) .artifact("org.apache.maven.plugins:maven-compiler-plugin:2.3.2") .resolveAs(GenericArchive.class));
-
2. Re: How to obtain an archive from a maven repo?
alrubinger Mar 26, 2011 6:00 PM (in response to aslak)As an aside, I think I finally figured out what was bothering me with this API, and it wasn't until I saw Juergen's question that this becme apparent why.
"Resolve" to me does not imply dependencies. "I want a Maven Coordinate, gimme it", is what I think when I see "resolve".
"Resolve With Dependencies" I think describes what we currently have.
So what do we think of:
<T extends Archive<T>> Iterable<T> MavenDependencyResolver.resolveWithDependenciesAs(T type); <T extends Archive<T>> T MavenDependencyResolver.resolveAs(T type);
...?
S,
ALR
-
3. Re: How to obtain an archive from a maven repo?
silenius Mar 28, 2011 9:39 PM (in response to alrubinger)I've been waiting for this feature for a long time... Maybe it's time for me to help implement it
Andrew would you like to create an issue with this info and assign it to me?
-
4. Re: How to obtain an archive from a maven repo?
aslak Mar 29, 2011 4:49 AM (in response to silenius)The feature was added in the latest Alpha12 release
https://repository.jboss.org/nexus/content/repositories/public-jboss/org/jboss/shrinkwrap/resolver/
But tweaking the API is up for grabs..
-
5. Re: How to obtain an archive from a maven repo?
silenius Mar 29, 2011 2:02 PM (in response to aslak)Hi Aslak,
I've been following SHRINKWRAP-140 for some time
I purpose to implement what Andrew suggested:
<T extends Archive<T>> Collection<T> MavenDependencyResolver.resolveWithDependenciesAs(T type); <T extends Archive<T>> T MavenDependencyResolver.resolveAs(T type);
And also a shorthand as requested by Nicklas at https://issues.jboss.org/browse/SHRINKWRAP-261.
Thinking about something like MavenArtifact.resolve("joda-time:joda-time:1.6") which returns a GenericArchive.
I should implement it later this week if it's ok with both of you.
-
6. Re: How to obtain an archive from a maven repo?
alrubinger Mar 30, 2011 11:10 AM (in response to silenius)Great to see you've taken these.
Let's see a proposal for SHRINKWRAP-261 before you dig in there, though? I like to run all API changes through the wider community. I think what we have in SHRINKWRAP-265 makes sense now.
S,
ALR
-
7. Re: How to obtain an archive from a maven repo?
silenius Mar 30, 2011 1:24 PM (in response to alrubinger)Hi Andrew,
I've created a new discussion on the developer forum so we can discuss it further: http://community.jboss.org/thread/164679.
-
8. Re: How to obtain an archive from a maven repo?
befield Apr 15, 2011 4:55 AM (in response to juergen.zimmermann)Hi
First of all, I'd like to thank you for your really nice work!
For the new project, we are switching from the old cactus test framework to arquilllian and shrinkwrap. Cool!
The problen we have is related to this discussion. We don't know exactly how to load maven archives. According Aslak's proposal, we are able to optain the archive but it is not complete. The META-INF information are not present.
The code snippet is:
ResourceAdapterArchive qfjJca = ShrinkWrap.create(ResourceAdapterArchive.class, "jca-qfj-adapter-sti-1_19-1.0.0.7.rar")
.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
.configureFrom(System.getenv().get("M2_HOME") + "/conf/settings.xml")
.loadReposFromPom("./pom.xml")
.artifact("com.swx.jca.qfj:jca-qfj-adapter-sti-1_19:1.0.0.7")
.resolveAs(ResourceAdapterArchive.class));
Note that without 'configureFrom' our local repository is not found.
Here is what the get:
jca-qfj-adapter-sti-1_19-1.0.0.7.rar:
/jca-qfj-adapter-sti-1_19-1.0.0.7.jar
/antlr-2.7.7.jar
/slf4j-jdk14-1.5.3.jar
/slf4j-api-1.5.3.jar
/stringtemplate-3.2.1.jar
/mina-core-1.1.0.jar
/quickfixj-1_4_0-sti-1_19-messages-1.0.0.0.jar
/quickfixj-core-1.4.0.swx1_swx.jar
Here is what we should get:
jca-qfj-adapter-sti-1_19-1.0.0.7.rar:
/jca-qfj-adapter-sti-1_19-1.0.0.7.jar
/antlr-2.7.7.jar
/slf4j-jdk14-1.5.3.jar
/slf4j-api-1.5.3.jar
/stringtemplate-3.2.1.jar
/mina-core-1.1.0.jar
/jline-0.9.94.jar
/META-INF/
/META-INF/maven/
/META-INF/maven/com.swx.jca.qfj/
/META-INF/maven/com.swx.jca.qfj/jca-qfj-adapter-sti-1_19/
/META-INF/maven/com.swx.jca.qfj/jca-qfj-adapter-sti-1_19/pom.properties
/META-INF/maven/com.swx.jca.qfj/jca-qfj-adapter-sti-1_19/pom.xml
/META-INF/jca-qfj-version.txt
/META-INF/MANIFEST.MF
/META-INF/ra.xml
/META-INF/jca-qfj-version_template.txt
/quickfixj-1_4_0-sti-1_19-messages-1.0.0.0.jar
/quickfixj-core-1.4.0.swx1_swx.jar
At the moment, we load this resource archive via zip importer.
Do you have an idea, what we have to change?
Thanks a lot Ralf