xml - Specify Library Target of Maven -
how can tell maven copy dependencies specific location?
side story: having gwt project in eclipse maven module larger project. gwt project has dependencies libraries , need them copied <project-dir>/war/web-inf/lib
. how can tell maven that?
edit: have found way copy single dependency - there way copy of them simple instruction?
<plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-dependency-plugin</artifactid> <version>2.10</version> <executions> <execution> <id>copy</id> <phase>package</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactitems> <artifactitem> <groupid>junit</groupid> <artifactid>junit</artifactid> <overwrite>false</overwrite> <outputdirectory>${basedir}/war/web-inf/lib</outputdirectory> <destfilename>optional-new-name.jar</destfilename> </artifactitem> </artifactitems> <outputdirectory>${project.build.directory}/wars</outputdirectory> <overwritereleases>false</overwritereleases> <overwritesnapshots>true</overwritesnapshots> </configuration> </execution> </executions> </plugin> </plugins>
i have tried this:
</dependencies> <build> <outputdirectory>${project.basedir}/war/web-inf/classes</outputdirectory> <plugins> <plugin> <artifactid>maven-dependency-plugin</artifactid> <executions> <execution> <phase>package</phase> <!-- <phase>deploy</phase> --> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputdirectory>${project.basedir}/war/web-inf/lib</outputdirectory> </configuration> </execution> </executions> </plugin> </plugins> </build>
ending error saying:
artifact has not been packaged yet. when used on reactor artifact, copy should executed after packaging: see mdep-187.
it looks you're trying bend maven things differently expects (e.g. here use war
both input , output folder). rule of thumb, never try fight maven, you'll lose eventually. follow (almost-undocumented) maven way™ or use another, more flexible tool (such ant+ivy or gradle).
if want use gwt maven within eclipse google plugin eclipse, have @ https://web.archive.org/web/20130619170526/https://developers.google.com/eclipse/docs/faq#gwt_with_maven , https://code.google.com/p/google-web-toolkit/wiki/workingwithmaven
to answer question directly, assuming project <packaging>war</packaging>
you'd have changed warsourcedirectory
src/main/webapp
default war
, try war:inplace
.
recommended approach though (see links above) use war:exploded
(or war:war
, i.e. simple mvn package
) , run gwt devmode using webappdirectory
, not warsourcedirectory
.
Comments
Post a Comment