Jul 05

In some cases, we’d like to get all the dependency jar files for a project. There is a maven plugin to do it simply, via a simple way. Just add the build sections to your pom file, as shown below:

  1.  
  2. <project>
  3. <!– ……. –>
  4. <build>
  5.         <plugins>
  6.                 <plugin>
  7.                                 <groupId>org.apache.maven.plugins</groupId>
  8.                                 <artifactId>maven-dependency-plugin</artifactId>
  9.                                 <executions>
  10.                                         <execution>
  11.                                                 <id>copy-dependencies</id>
  12.                                                 <phase>process-sources</phase>
  13.                                                 <goals>
  14.                                                         <goal>copy-dependencies</goal>
  15.                                                 </goals>
  16.                                                 <configuration>
  17.                                                         <outputDirectory>c:\output</outputDirectory>
  18.                                                         <overWriteReleases>false</overWriteReleases>
  19.                                                         <overWriteSnapshots>false</overWriteSnapshots>
  20.                                                         <overWriteIfNewer>true</overWriteIfNewer>
  21.                                                 </configuration>
  22.                                         </execution>
  23.                                 </executions>
  24.                         </plugin>
  25.                         </plugins>
  26.         </build>
  27.  
  28. <!– ……. –>
  29.  
  30. </project>
  31.  
  • Share/Bookmark
Feb 05

I have maven2 with eclipse. Each time eclipse starts up, it complains:

2/5/09 5:45:53 PM EST: Eclipse is running in a JRE, but a JDK is required
Some Maven plugins may not work when importing projects or updating source folders.

The recommend solution doesn’t work. I finally find a working one. Just add the following command argument to starting command. You can create a shell script (.bat) or change your shortcut command. The argument is:

-vm “c:\Program Files\java\jdk1.6.0_10\bin”

Of course, you need to change the path pointing to your own JDK directory.

  • Share/Bookmark