You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steinar Bang <sb...@dod.no> on 2016/02/28 21:22:03 UTC
Is there a way to download and unzip the latest version of an artifact?
Is there a way to find what the latest version of an artifact, and then
download and unzip the artifact?
My usecase is that I would like a simple way to download and unzip the
newest version of an izpack installer from a local Nexus repository.
I've googled a bit, and a possible solution would be to use this to set
the correct version in a property
http://www.mojohaus.org/versions-maven-plugin/examples/update-properties.html
and then I could to a new mvn invocation to dependency:unpack the zip
file.
But it would be neat if I could bind some executions to a couple of
lifecycle phases,and then just do
mvn clean install
and after that invocation have a fresh target directory filled with a
ready to go unpacked zip file containing an izpack installer.
Thanks!
- Steinar
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Is there a way to download and unzip the latest version of an artifact?
Posted by Steinar Bang <sb...@dod.no>.
>>>>> Steinar Bang <sb...@dod.no>:
>>>>> Anders Hammar <an...@hammar.net>:
>> Possibly you could use a range with no upper limit for a dependency and
>> then bind dependency:unpack.
> Ah, ok, so that is possible...?
> Definitely something to try!
That worked, but not for dependency:unpack (because the artifactItems'
version numbers can't handle ranges).
However, it worked with using dependency:unpack-dependencies and having
the izpack installer as a dependency.
I released version 0.0.2 into a locally installed nexus OSS, and did
"mvn clean install" on the POM below, and the 0.0.2 installer zip was
downloaded and unpacked.
Yay! :-)
But note the setting:
<excludeTransitive>true</excludeTransitive>
Without this setting the POM downloads and unpacks waaay too much...:-)
Here's the working download-and-unpack POM:
<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>no.priv.bang.fuseki</groupId>
<artifactId>download-service-installer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>download-service-installer</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>no.priv.bang.fuseki</groupId>
<artifactId>fusekiservice</artifactId>
<version>[0.0.1,)</version>
<type>zip</type>
<classifier>installer</classifier>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>unpack-service-installer</id>
<phase>initialize</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Is there a way to download and unzip the latest version of an artifact?
Posted by Steinar Bang <sb...@dod.no>.
>>>>> Anders Hammar <an...@hammar.net>:
> Possibly you could use a range with no upper limit for a dependency and
> then bind dependency:unpack.
Ah, ok, so that is possible...?
Definitely something to try!
Thanks for the tip!
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Is there a way to download and unzip the latest version of an artifact?
Posted by Anders Hammar <an...@hammar.net>.
Possibly you could use a range with no upper limit for a dependency and
then bind dependency:unpack.
/Anders
On Sun, Feb 28, 2016 at 9:22 PM, Steinar Bang <sb...@dod.no> wrote:
> Is there a way to find what the latest version of an artifact, and then
> download and unzip the artifact?
>
> My usecase is that I would like a simple way to download and unzip the
> newest version of an izpack installer from a local Nexus repository.
>
> I've googled a bit, and a possible solution would be to use this to set
> the correct version in a property
>
> http://www.mojohaus.org/versions-maven-plugin/examples/update-properties.html
> and then I could to a new mvn invocation to dependency:unpack the zip
> file.
>
> But it would be neat if I could bind some executions to a couple of
> lifecycle phases,and then just do
> mvn clean install
> and after that invocation have a fresh target directory filled with a
> ready to go unpacked zip file containing an izpack installer.
>
> Thanks!
>
>
> - Steinar
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Is there a way to download and unzip the latest version of an artifact?
Posted by Bing Shiao <bi...@gmail.com>.
Steinar,
Suppose you want to download izpack-installer-5.0.6.jar, and unzip/unjar
the files into target directory, here is how I did it with the help of
maven-dependency-plugin.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.codehaus.izpack</groupId>
<artifactId>izpack-installer</artifactId>
<version>5.0.6</version>
<type>jar</type>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
On Sun, Feb 28, 2016 at 12:22 PM, Steinar Bang <sb...@dod.no> wrote:
> Is there a way to find what the latest version of an artifact, and then
> download and unzip the artifact?
>
> My usecase is that I would like a simple way to download and unzip the
> newest version of an izpack installer from a local Nexus repository.
>
> I've googled a bit, and a possible solution would be to use this to set
> the correct version in a property
>
> http://www.mojohaus.org/versions-maven-plugin/examples/update-properties.html
> and then I could to a new mvn invocation to dependency:unpack the zip
> file.
>
> But it would be neat if I could bind some executions to a couple of
> lifecycle phases,and then just do
> mvn clean install
> and after that invocation have a fresh target directory filled with a
> ready to go unpacked zip file containing an izpack installer.
>
> Thanks!
>
>
> - Steinar
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>