Recently I was having requirement to download Eclipse JDT compiler (ECJ 4.6.1) on to my Linux VM system. The maven repository was not having any option for me to download using wget or any other browser (at least I was not able to see). All I could see a Maven dependency to download the JAR file. After bit of research and google I came out with following Maven POM file which can be used to download the dependencies,


<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                   http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dependency-download</groupId>
<artifactId>dependency-download</artifactId>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
  <!-- COPY YOUR DEPENDENCY TAG HERE -->
  <dependency>
    <groupId>org.eclipse.jdt.core.compiler</groupId>
    <artifactId>ecj</artifactId>
    <version>4.6.1</version>
  </dependency>
</dependencies>
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <version>2.8</version>
      <executions>
        <execution>
          <id>my-dependency-downloader</id>
          <phase>package</phase>
          <goals>
            <goal>copy-dependencies</goal>
          </goals>
          <configuration>
            <outputDirectory>dependencies</outputDirectory>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
</project>

For more details about copying dependencies, refer here.

Leave a Reply

Your email address will not be published.

WP2Social Auto Publish Powered By : XYZScripts.com