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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to