Thx all for your input!
i'm currently using maven-dependency-plugin and unpack. It works perfectly,
when one wants to extract a file from a dependent jar. Here's the code snipped,
for those who are searching for a similar solution: Easy when you know the
right plugin for the right job :). Especially because all logic is situated in
parent poms (besides the special cases) - as i like it.
<!-- unpack xsd's of afbcommon.jar to temp, where temp is
${project.build.directory}/temp -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>de.afb</groupId>
<artifactId>afbCommon</artifactId>
<version>1.0-SNAPSHOT</version>
<outputDirectory>${temp.directory}</outputDirectory>
<includes>*.xsd</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
> That's a reasonable solution (though I'm not sure why copying to a
> defined location is needed, you should be able to refer to it from the
> dependency:unpack location).
@Brett: yes indeed, that was my plan. The temp directory IS the predefined
position.
-----Ursprüngliche Nachricht-----
Von: Brett Porter [mailto:[email protected]] Im Auftrag von Brett Porter
Gesendet: Montag, 28. September 2009 01:29
An: Maven Users List
Betreff: Re: AW: copy file from dependent jar
On 25/09/2009, at 6:24 PM, Entner Harald wrote:
> The ant script has in my opinion a bad side effect. The structure is
> not allowed to change, so i would prefer to use dependencies so
> structure changes would have no side effects.
>
> Currently i use the maven-dependency-plugin that copies the file to
> a defined position and wrote a plugin that handles the extraction
> and the replacement.
That's a reasonable solution (though I'm not sure why copying to a
defined location is needed, you should be able to refer to it from the
dependency:unpack location).
However, the CXF codegen plugin also has an option to download the
WSDL from a Maven artifact:
http://cwiki.apache.org/CXF20DOC/maven-cxf-codegen-plugin-wsdl-to-java.html
(at the bottom) which will work better for you.
- Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]