You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ron Wheeler <rw...@artifact-software.com> on 2015/05/08 05:56:01 UTC

dependency plug-in docs wrong or misleading.

In 
http://maven.40175.n5.nabble.com/copy-libraries-to-classpath-td110698.html, 
Brian Fox wrote a key response with a reference to an obscure reference 
in the dependency FAQ 
athttps://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html

Buried in the FAQ under copying from the command line it states "you 
must not put the configuration inside the/executions/tag."

This should be added as a configuration and explanation to the main 
examples page  at 
https://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html

<project>
   [...]
   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <version>2.10</version>
         <executions>
           <execution>
             <id>copy-dependencies</id>
             <phase>package</phase>
             <goals>
               <goal>copy-dependencies</goal>
             </goals>
             <configuration>
               <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
               <overWriteReleases>false</overWriteReleases>
               <overWriteSnapshots>false</overWriteSnapshots>
               <overWriteIfNewer>true</overWriteIfNewer>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>
   [...]
</project>

If you are running from the command line of from an IDE, you need to change the position of the configuration section to be a sibling of the <executions> element

<project>
   [...]
   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <version>2.10</version>
         <configuration>
             <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
             <overWriteReleases>false</overWriteReleases>
             <overWriteSnapshots>false</overWriteSnapshots>
             <overWriteIfNewer>true</overWriteIfNewer>
         </configuration>
         <executions>
           <execution>
             <id>copy-dependencies</id>
             <phase>package</phase>
             <goals>
               <goal>copy-dependencies</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>
   [...]
</project>



-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


Re: dependency plug-in docs wrong or misleading.

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Ron,

> This should be added as a configuration and explanation to the main
> examples page

IIUC, we can submit patches for this sort of change. The repo on GitHub is:

https://github.com/apache/maven-plugins/blob/trunk/maven-dependency-plugin/src/site/apt/examples/copying-artifacts.apt.vm

As of this writing, the lines in question are:

https://github.com/apache/maven-plugins/blob/a2943b37832f8787147b1bfd292e1a13be2ec672/maven-dependency-plugin/src/site/apt/examples/copying-artifacts.apt.vm#L43-L67

And looking at the repo, it seems that PRs are being accepted. So I filed
one:
    https://github.com/apache/maven-plugins/pull/52

Cheers,
Curtis

On Thu, May 7, 2015 at 10:56 PM, Ron Wheeler <rwheeler@artifact-software.com
> wrote:

> In
> http://maven.40175.n5.nabble.com/copy-libraries-to-classpath-td110698.html,
> Brian Fox wrote a key response with a reference to an obscure reference in
> the dependency FAQ athttps://
> maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html
>
> Buried in the FAQ under copying from the command line it states "you must
> not put the configuration inside the/executions/tag."
>
> This should be added as a configuration and explanation to the main
> examples page  at
> https://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html
>
> <project>
>   [...]
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-dependency-plugin</artifactId>
>         <version>2.10</version>
>         <executions>
>           <execution>
>             <id>copy-dependencies</id>
>             <phase>package</phase>
>             <goals>
>               <goal>copy-dependencies</goal>
>             </goals>
>             <configuration>
>
> <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
>               <overWriteReleases>false</overWriteReleases>
>               <overWriteSnapshots>false</overWriteSnapshots>
>               <overWriteIfNewer>true</overWriteIfNewer>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>   [...]
> </project>
>
> If you are running from the command line of from an IDE, you need to
> change the position of the configuration section to be a sibling of the
> <executions> element
>
> <project>
>   [...]
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-dependency-plugin</artifactId>
>         <version>2.10</version>
>         <configuration>
>
> <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
>             <overWriteReleases>false</overWriteReleases>
>             <overWriteSnapshots>false</overWriteSnapshots>
>             <overWriteIfNewer>true</overWriteIfNewer>
>         </configuration>
>         <executions>
>           <execution>
>             <id>copy-dependencies</id>
>             <phase>package</phase>
>             <goals>
>               <goal>copy-dependencies</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
>   [...]
> </project>
>
>
>
> --
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
>
>