You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jp4 <jo...@hnpsolutions.com> on 2007/01/15 16:44:30 UTC

Clearing out local repository during nightly builds

Recently I have had some issues with version management where we upgrade a
particular artifact to a new version, but some how, not all projects
reference the new version.  I have tried to mitigate this by making use of
the dependencyManagement section which works nicely.  

I would still however, like to clean out the local repository (only a
certain directory com/foo) so that I don't encounter this problem in the
future.  My problem now is that I have a pom.xml that builds all of my
modules.  In addition, this pom uses the antrun plugin to remove the
directory from the local repo.  This works fine if I do a mvn clean then a
mvn install, but if I do a mvn clean install, the last thing that happens is
the delete.  Is there any way to have this run before any of the modules are
built?

Thanks,

jp4
-- 
View this message in context: http://www.nabble.com/Clearing-out-local-repository-during-nightly-builds-tf3015348s177.html#a8373630
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Clearing out local repository during nightly builds

Posted by jp4 <jo...@hnpsolutions.com>.
My solution wasn't elegant, but I had to make it simple.

I created a "clean project" which was the first module listed in the main
pom.xml.  The clean project pom.xml looked something like this... It runs an
ant script to do the delete.  Hope this helps.  

<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>com.foo.common</groupId>
	<artifactId>common-clean</artifactId>
	<version>1.0-SNAPSHOT</version>
	<name>${artifactId}</name>
	<packaging>pom</packaging>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean</id>
                        <phase>clean</phase>
                        <configuration>
                            <tasks>
                                <property name="user.home"
value="${user.home}"/>
                                <property name="m2.repo"
value="${user.home}/.m2/repository"/>
                                <property name="foo.repo.dir"
value="${m2.repo}/com/foo"/>
                                <echo>i4commerce dir =
${foo.repo.dir}</echo>
                                <delete dir="${foo.repo.dir}"/>
                            </tasks>
                        </configuration>
                        <goals> 
                            <goal>run</goal> 
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
          <site>
                <id>repository</id>
                <url>scp://gondor/var/www/html/mavenSite/</url>
          </site>
            <repository>
                  <id>repository</id>
                  <url>scp://gondor/var/www/html/maven</url>
            </repository>
    </distributionManagement>

</project>


Thierry Lach-2 wrote:
> 
> OK I've also been waiting for an answer on this.  Anyone know?
> 
> On 1/15/07, jp4 <jo...@hnpsolutions.com> wrote:
>>
>>
>> Recently I have had some issues with version management where we upgrade
>> a
>> particular artifact to a new version, but some how, not all projects
>> reference the new version.  I have tried to mitigate this by making use
>> of
>> the dependencyManagement section which works nicely.
>>
>> I would still however, like to clean out the local repository (only a
>> certain directory com/foo) so that I don't encounter this problem in the
>> future.  My problem now is that I have a pom.xml that builds all of my
>> modules.  In addition, this pom uses the antrun plugin to remove the
>> directory from the local repo.  This works fine if I do a mvn clean then
>> a
>> mvn install, but if I do a mvn clean install, the last thing that happens
>> is
>> the delete.  Is there any way to have this run before any of the modules
>> are
>> built?
>>
>> Thanks,
>>
>> jp4
>> --
>> View this message in context:
>> http://www.nabble.com/Clearing-out-local-repository-during-nightly-builds-tf3015348s177.html#a8373630
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Clearing-out-local-repository-during-nightly-builds-tf3015348s177.html#a8432680
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Clearing out local repository during nightly builds

Posted by Thierry Lach <th...@gmail.com>.
OK I've also been waiting for an answer on this.  Anyone know?

On 1/15/07, jp4 <jo...@hnpsolutions.com> wrote:
>
>
> Recently I have had some issues with version management where we upgrade a
> particular artifact to a new version, but some how, not all projects
> reference the new version.  I have tried to mitigate this by making use of
> the dependencyManagement section which works nicely.
>
> I would still however, like to clean out the local repository (only a
> certain directory com/foo) so that I don't encounter this problem in the
> future.  My problem now is that I have a pom.xml that builds all of my
> modules.  In addition, this pom uses the antrun plugin to remove the
> directory from the local repo.  This works fine if I do a mvn clean then a
> mvn install, but if I do a mvn clean install, the last thing that happens
> is
> the delete.  Is there any way to have this run before any of the modules
> are
> built?
>
> Thanks,
>
> jp4
> --
> View this message in context:
> http://www.nabble.com/Clearing-out-local-repository-during-nightly-builds-tf3015348s177.html#a8373630
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Clearing out local repository during nightly builds

Posted by franz see <fr...@gmail.com>.
Good day to you, jp4,

Can you paste here the logs of your mvn clean, mvn install, and mvn clean
install?

Thanks,
Franz


jp4 wrote:
> 
> Recently I have had some issues with version management where we upgrade a
> particular artifact to a new version, but some how, not all projects
> reference the new version.  I have tried to mitigate this by making use of
> the dependencyManagement section which works nicely.  
> 
> I would still however, like to clean out the local repository (only a
> certain directory com/foo) so that I don't encounter this problem in the
> future.  My problem now is that I have a pom.xml that builds all of my
> modules.  In addition, this pom uses the antrun plugin to remove the
> directory from the local repo.  This works fine if I do a mvn clean then a
> mvn install, but if I do a mvn clean install, the last thing that happens
> is the delete.  Is there any way to have this run before any of the
> modules are built?
> 
> Thanks,
> 
> jp4
> 

-- 
View this message in context: http://www.nabble.com/Clearing-out-local-repository-during-nightly-builds-tf3015348s177.html#a8432626
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org