maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Entner Harald" <>
Subject copy file from dependent jar
Date Thu, 24 Sep 2009 10:01:49 GMT


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: 








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 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message