Hi Brett,
Yes, Resource1.xsd is part of Proj1. And there is a dependency between Proj3
and Proj1.
Maybe i should explain it differently:
I need to run wsdl2java (i use the cxf plugin for that) which needs the
Resource1.xsd to be able to run correctly. Additionally some namespaces have to
be adapted.
So i need to extract one file from a dependent artifact, place it in a project
specific directory and do some replacements.
The build script (in ant) looks like this:
<target name="copyXSDs" description="Copy XSDs to
src/conf/xml-resources/....">
<copy file="${cms.root}/Common/afbCommon/xsd/xxxGlobal.xsd"
todir="${xsd.dest}"/>
</target>
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.
regards,
Harald
-----Ursprüngliche Nachricht-----
Von: Brett Porter [mailto:[email protected]] Im Auftrag von Brett Porter
Gesendet: Freitag, 25. September 2009 03:55
An: Maven Users List
Betreff: Re: copy file from dependent jar
I'm a bit lost. Is Resource1 already included in Proj1 and is Proj1 a
dependency of Proj3?
- Brett
On 24/09/2009, at 8:01 PM, Entner Harald wrote:
> Hello,
>
>
>
> i face the following problem. Currently i'm refactoring a project so
> that i can move from ant to maven. It works rather well (i have done
> this in my old company as well), but some special cases occur. Most of
> them i could fix, but one causes me a headache.
>
>
>
> This is the simple view of the project layout:
>
>
>
> Proj1
>
> Resource1.xsd
>
> Proj2
>
> Proj3
>
>
>
>
>
> The thing is, that Proj3 (actually all Webservices) needs Resource1
> (besides it should do some replacements on the content of
> Resource1.xd).
> So far ant copies the file using relative paths. I would really like
> to
> avoid that (it would be easy with relative paths), because it adds a
> lot
> of dependencies. (the project structure is much bigger and has a lot
> of
> subprojects, the file is needed in many places).
>
>
>
> So one solution would be to use the maven-resource-plugin and let it
> copy the resource (additionally it could do the replacement).
> Unfortunately, it only works with paths, but not with dependent
> projects. Or am i missing something?
>
>
>
>
>
> The solution i am thinking about is to use the dependency plugin and
> copy the resource first (it can handle dependent jars) and place it
> in a
> predefined-(project)-place (i think i can put it into the parent pom,
> and hopefully this will work under all circumstances). Then i could
> use
> the resource-plugin to do the rest and so i only have the resource
> plugin inside the project poms.
>
>
>
> The bad thing is that i need a second parent. Because Proj1 should not
> execute dependency:copy (as it is depends on itself). I could leave
> the
> phase undefined, but then i would have to add the plugin in every
> project pom, which i would like to avoid. I think i could live with
> this
> solution, but i m wondering if nobody had the same problem and maybe
> there is a better solution.
>
>
>
> Every input is appreciated.
>
>
>
> regards, Harald
>
---------------------------------------------------------------------
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]