0

I am using the maven-dependency-plugin to specify some artifacts for download. I know from the artifact the Group ID, the Artifact ID and the Version. The plugin itself will find it “somewhere”.

Example (shorten):

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-dependency-plugin</artifactId>
 <version>2.9</version>
<executions>
 . . .
 <artifactItem>
  <groupId>${GROUPID}</groupId>
  <artifactId>${ARTIFACTID}</artifactId>
  <version>${APP_VERSION}</version>
  <outputDirectory>../target/content/</outputDirectory>
  <destFileName>${GROUPID}-${APP_VERSION}.zip.wrap</destFileName>
  <type>zip</type>
 </artifactItem>
 . . .

It works and show me on the (std) output the message:

[INFO] --- maven-dependency-plugin:2.9:unpack (copy) 
[INFO] Configured Artifact: com.s. . .:1.1.2:zip
Downloading: http://nexus:8081/nexus/content/groups/build.snapshots/ com/s.../1.1.2/...-1.1.2.zip
Downloaded: http://nexus:8081/nexus/content/groups/build.snapshots/com/s.../1.1.2/...-1.1.2.zip (77480 KB at 1721.5 KB/sec)

Do I have the possibility to get the used download URL within my pom file? I want to echo the used URL for downloading in a separate file. Do you have a hint for me?

Thank you. Dennis

  • Why do you use maven-dependency-plugin to download artifacts? Defined them as usual dependencies and that's it and Maven takes care of it...Can you explain what you like to achieve with those zip files? – khmarbaise Nov 18 '15 at 15:11
  • I use the maven-dependency-plugin because with my three coordinates: group id, artifact id and version it does exactly what I want. It downloads from somewhere the artifact and store it on my configured location. But what I need is the used download location. This information need to be part of a manifest file. Within the zip file is another zip file (don't ask - bad architecture) - I download this zip file and extract it directly (with unpack). but I just want to know the used download url to print them into a separate file. – Dennis Adler Nov 19 '15 at 12:47

0 Answers0