You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by eyal edri <ey...@gmail.com> on 2010/02/11 10:01:12 UTC
when using "copy-dependencies" goal in dependency plugin, how can i
install old version to overwrite a new one
I'm trying to installer an older version of my project (to check rollback
option),
how can i tell maven to remove the new versions installed and replace with
older one?
the other way works perfect.
my pom:
<plugin>
<!-- copy artifact target to classpath -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
<overWrite>true</overWrite>
<outputDirectory>${classpath}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<!-- copy artifact dependencies to classpath -->
<execution>
<id>copy-dependencies</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${classpath}</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<stripVersion>false</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
--
Eyal Edri
Re: when using "copy-dependencies" goal in dependency plugin, how can
i install old version to overwrite a new one
Posted by eyal edri <ey...@gmail.com>.
no, i mean that it will delete the new one and install the old one.
today, (when you install a newer version, maven deletes the old and install
the new - if you config to overwrite).
On Fri, Feb 12, 2010 at 4:16 PM, Baptiste MATHUS <ml...@batmat.net> wrote:
> You mean the new version will stay, but the older will also be added in the
> target directory?
>
>
> 2010/2/12 eyal edri <ey...@gmail.com>
>
> > let's say I've got a maven project that when i install it, it installs
> all
> > the dependencies to the classPath.
> >
> > but now i found that i need one of the dependencies in a version that is
> > older than what i installed.
> > so i go to the pom.xml and change it to an older version.
> >
> > in the current configuration, after running mvn install, nothing will
> > happen
> > (the newer version of the dependency will stay).
> >
> > (of course i can go to the classpath and manually delete the newer
> > dependency.jar, but i rather maven will do it :).
> >
> > any ideas?
> >
> >
> >
> > On Fri, Feb 12, 2010 at 2:48 PM, Baptiste MATHUS <ml...@batmat.net> wrote:
> >
> > > *Hi,*
> > >
> > > What do you mean? You'd like that the target directory doesn't contain
> > bad
> > > dependency version? If so, then couldn't you just add the "clean"
> option
> > > before your goal? (mvn clean).
> > >
> > > *Cheers.*
> > >
> > > 2010/2/11 eyal edri <ey...@gmail.com>
> > >
> > > > I'm trying to installer an older version of my project (to check
> > rollback
> > > > option),
> > > >
> > > > how can i tell maven to remove the new versions installed and replace
> > > with
> > > > older one?
> > > >
> > > > the other way works perfect.
> > > >
> > > >
> > > > my pom:
> > > >
> > > > <plugin>
> > > > <!-- copy artifact target to classpath -->
> > > > <groupId>org.apache.maven.plugins</groupId>
> > > > <artifactId>maven-dependency-plugin</artifactId>
> > > > <executions>
> > > > <execution>
> > > > <id>copy</id>
> > > > <phase>install</phase>
> > > > <goals>
> > > > <goal>copy</goal>
> > > > </goals>
> > > > <configuration>
> > > > <artifactItems>
> > > > <artifactItem>
> > > > <groupId>${project.groupId}</groupId>
> > > > <artifactId>${project.artifactId}</artifactId>
> > > > <version>${project.version}</version>
> > > > <type>${project.packaging}</type>
> > > > <overWrite>true</overWrite>
> > > > <outputDirectory>${classpath}</outputDirectory>
> > > > </artifactItem>
> > > > </artifactItems>
> > > > </configuration>
> > > > </execution>
> > > > <!-- copy artifact dependencies to classpath -->
> > > > <execution>
> > > > <id>copy-dependencies</id>
> > > > <phase>install</phase>
> > > > <goals>
> > > > <goal>copy-dependencies</goal>
> > > > </goals>
> > > > <configuration>
> > > > <outputDirectory>${classpath}</outputDirectory>
> > > > <overWriteReleases>true</overWriteReleases>
> > > > <overWriteSnapshots>true</overWriteSnapshots>
> > > > <overWriteIfNewer>true</overWriteIfNewer>
> > > > <stripVersion>false</stripVersion>
> > > > </configuration>
> > > > </execution>
> > > > </executions>
> > > > </plugin>
> > > >
> > > > --
> > > > Eyal Edri
> > > >
> > >
> > >
> > >
> > > --
> > > Baptiste <Batmat> MATHUS - http://batmat.net
> > > Sauvez un arbre,
> > > Mangez un castor !
> > >
> >
> >
> >
> > --
> > Eyal Edri
> >
>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>
--
Eyal Edri
Re: when using "copy-dependencies" goal in dependency plugin, how can
i install old version to overwrite a new one
Posted by Baptiste MATHUS <ml...@batmat.net>.
You mean the new version will stay, but the older will also be added in the
target directory?
2010/2/12 eyal edri <ey...@gmail.com>
> let's say I've got a maven project that when i install it, it installs all
> the dependencies to the classPath.
>
> but now i found that i need one of the dependencies in a version that is
> older than what i installed.
> so i go to the pom.xml and change it to an older version.
>
> in the current configuration, after running mvn install, nothing will
> happen
> (the newer version of the dependency will stay).
>
> (of course i can go to the classpath and manually delete the newer
> dependency.jar, but i rather maven will do it :).
>
> any ideas?
>
>
>
> On Fri, Feb 12, 2010 at 2:48 PM, Baptiste MATHUS <ml...@batmat.net> wrote:
>
> > *Hi,*
> >
> > What do you mean? You'd like that the target directory doesn't contain
> bad
> > dependency version? If so, then couldn't you just add the "clean" option
> > before your goal? (mvn clean).
> >
> > *Cheers.*
> >
> > 2010/2/11 eyal edri <ey...@gmail.com>
> >
> > > I'm trying to installer an older version of my project (to check
> rollback
> > > option),
> > >
> > > how can i tell maven to remove the new versions installed and replace
> > with
> > > older one?
> > >
> > > the other way works perfect.
> > >
> > >
> > > my pom:
> > >
> > > <plugin>
> > > <!-- copy artifact target to classpath -->
> > > <groupId>org.apache.maven.plugins</groupId>
> > > <artifactId>maven-dependency-plugin</artifactId>
> > > <executions>
> > > <execution>
> > > <id>copy</id>
> > > <phase>install</phase>
> > > <goals>
> > > <goal>copy</goal>
> > > </goals>
> > > <configuration>
> > > <artifactItems>
> > > <artifactItem>
> > > <groupId>${project.groupId}</groupId>
> > > <artifactId>${project.artifactId}</artifactId>
> > > <version>${project.version}</version>
> > > <type>${project.packaging}</type>
> > > <overWrite>true</overWrite>
> > > <outputDirectory>${classpath}</outputDirectory>
> > > </artifactItem>
> > > </artifactItems>
> > > </configuration>
> > > </execution>
> > > <!-- copy artifact dependencies to classpath -->
> > > <execution>
> > > <id>copy-dependencies</id>
> > > <phase>install</phase>
> > > <goals>
> > > <goal>copy-dependencies</goal>
> > > </goals>
> > > <configuration>
> > > <outputDirectory>${classpath}</outputDirectory>
> > > <overWriteReleases>true</overWriteReleases>
> > > <overWriteSnapshots>true</overWriteSnapshots>
> > > <overWriteIfNewer>true</overWriteIfNewer>
> > > <stripVersion>false</stripVersion>
> > > </configuration>
> > > </execution>
> > > </executions>
> > > </plugin>
> > >
> > > --
> > > Eyal Edri
> > >
> >
> >
> >
> > --
> > Baptiste <Batmat> MATHUS - http://batmat.net
> > Sauvez un arbre,
> > Mangez un castor !
> >
>
>
>
> --
> Eyal Edri
>
--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
Re: when using "copy-dependencies" goal in dependency plugin, how can
i install old version to overwrite a new one
Posted by eyal edri <ey...@gmail.com>.
let's say I've got a maven project that when i install it, it installs all
the dependencies to the classPath.
but now i found that i need one of the dependencies in a version that is
older than what i installed.
so i go to the pom.xml and change it to an older version.
in the current configuration, after running mvn install, nothing will happen
(the newer version of the dependency will stay).
(of course i can go to the classpath and manually delete the newer
dependency.jar, but i rather maven will do it :).
any ideas?
On Fri, Feb 12, 2010 at 2:48 PM, Baptiste MATHUS <ml...@batmat.net> wrote:
> *Hi,*
>
> What do you mean? You'd like that the target directory doesn't contain bad
> dependency version? If so, then couldn't you just add the "clean" option
> before your goal? (mvn clean).
>
> *Cheers.*
>
> 2010/2/11 eyal edri <ey...@gmail.com>
>
> > I'm trying to installer an older version of my project (to check rollback
> > option),
> >
> > how can i tell maven to remove the new versions installed and replace
> with
> > older one?
> >
> > the other way works perfect.
> >
> >
> > my pom:
> >
> > <plugin>
> > <!-- copy artifact target to classpath -->
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-dependency-plugin</artifactId>
> > <executions>
> > <execution>
> > <id>copy</id>
> > <phase>install</phase>
> > <goals>
> > <goal>copy</goal>
> > </goals>
> > <configuration>
> > <artifactItems>
> > <artifactItem>
> > <groupId>${project.groupId}</groupId>
> > <artifactId>${project.artifactId}</artifactId>
> > <version>${project.version}</version>
> > <type>${project.packaging}</type>
> > <overWrite>true</overWrite>
> > <outputDirectory>${classpath}</outputDirectory>
> > </artifactItem>
> > </artifactItems>
> > </configuration>
> > </execution>
> > <!-- copy artifact dependencies to classpath -->
> > <execution>
> > <id>copy-dependencies</id>
> > <phase>install</phase>
> > <goals>
> > <goal>copy-dependencies</goal>
> > </goals>
> > <configuration>
> > <outputDirectory>${classpath}</outputDirectory>
> > <overWriteReleases>true</overWriteReleases>
> > <overWriteSnapshots>true</overWriteSnapshots>
> > <overWriteIfNewer>true</overWriteIfNewer>
> > <stripVersion>false</stripVersion>
> > </configuration>
> > </execution>
> > </executions>
> > </plugin>
> >
> > --
> > Eyal Edri
> >
>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>
--
Eyal Edri
Re: when using "copy-dependencies" goal in dependency plugin, how can
i install old version to overwrite a new one
Posted by Baptiste MATHUS <ml...@batmat.net>.
*Hi,*
What do you mean? You'd like that the target directory doesn't contain bad
dependency version? If so, then couldn't you just add the "clean" option
before your goal? (mvn clean).
*Cheers.*
2010/2/11 eyal edri <ey...@gmail.com>
> I'm trying to installer an older version of my project (to check rollback
> option),
>
> how can i tell maven to remove the new versions installed and replace with
> older one?
>
> the other way works perfect.
>
>
> my pom:
>
> <plugin>
> <!-- copy artifact target to classpath -->
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-dependency-plugin</artifactId>
> <executions>
> <execution>
> <id>copy</id>
> <phase>install</phase>
> <goals>
> <goal>copy</goal>
> </goals>
> <configuration>
> <artifactItems>
> <artifactItem>
> <groupId>${project.groupId}</groupId>
> <artifactId>${project.artifactId}</artifactId>
> <version>${project.version}</version>
> <type>${project.packaging}</type>
> <overWrite>true</overWrite>
> <outputDirectory>${classpath}</outputDirectory>
> </artifactItem>
> </artifactItems>
> </configuration>
> </execution>
> <!-- copy artifact dependencies to classpath -->
> <execution>
> <id>copy-dependencies</id>
> <phase>install</phase>
> <goals>
> <goal>copy-dependencies</goal>
> </goals>
> <configuration>
> <outputDirectory>${classpath}</outputDirectory>
> <overWriteReleases>true</overWriteReleases>
> <overWriteSnapshots>true</overWriteSnapshots>
> <overWriteIfNewer>true</overWriteIfNewer>
> <stripVersion>false</stripVersion>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> --
> Eyal Edri
>
--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !