Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn clean install do not use last .class version

It seems Maven keep using use an old version of my code when packaging a war archive.

I build my war using a simple "mvn clean install".

I deleted the /target folder by hand and checked that there were no .class elsewhere in my project (as described here).

Each time I check the generated archive, an old version of my code has been packaged inside. Yet, the same code is properly packaged on my colleague's machine (he uses m2e).

Does anyone have the same problem ?

Here is the most relevant part of the POM:

<packaging>war</packaging>
... 
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <!-- <version>2.3.2</version> -->
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
        </plugin>
    </plugins>
</build>
like image 282
otonglet Avatar asked Nov 01 '22 21:11

otonglet


1 Answers

It appears that the old code is still present somewhere; my guess would be your local repository. Try deleting any entry there that could contain the old code and then building your project again.

like image 139
blalasaadri Avatar answered Nov 09 '22 12:11

blalasaadri