Why might Maven ignore updated classes during install?

前端 未结 1 654
说谎
说谎 2021-01-21 06:21

I\'ve been seeing odd behaviour from my Maven 2.2.1 installation whilst doing war installs.

Occasionally, I will update a class but the updated version is not packaged u

相关标签:
1条回答
  • 2021-01-21 06:40

    So far, I have determined that an updated .class file is produced in the target directory, and that the class of the same name in the produced .war is not the same (different date modified, different size)

    Just to be sure, the classes should be built under target\classes, not target.

    • Can I force Maven to build a package from scratch?

    You can force a full build by running

    mvn clean install
    

    This performs a clean (essentially removes the target directory) before running the install phase.

    Also - check for copies of your classes outside of the Maven build directory. In this case as it is a webapp, check src/main/webapp/WEB-INF/classes

    0 讨论(0)
提交回复
热议问题