문제

When you run the maven war:inplace all the classes and libraries are copied to the webapp folder of your project. When I update the version number of a library, i end up with two versions of the respective jar in the lib folder, the old one and the new one.

Is there any way to clean the lib folder before the new libraries get copied?

("mvn clean install war:inplace" doesn't do the job...)

도움이 되었습니까?

해결책

I had to do this exact same thing in my projects, here's what I did:

Add the following to your pom.xml within the <plugins> tag, it customizes the clean plugin to remove the WEB-INF/classes and WEB-INF/lib directories:

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.4.1</version>
    <configuration>
        <filesets>
            <fileset>
                <directory>src/main/webapp/WEB-INF/classes</directory>
            </fileset>
            <fileset>
                <directory>src/main/webapp/WEB-INF/lib</directory>
            </fileset>
        </filesets>
    </configuration>
</plugin>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top