Why can Maven ignore updated classes during installation?

I observe strange behavior from my Maven 2.2.1 installation when performing military installations.

Sometimes I update a class, but the updated version is not packaged in the artifact created by the mvn installation.

So far, I have determined that an updated .class file is created in the target directory and that the class with the same name in the produced .war does not match (another date changed, different size)

Running Maven from the command line with the -X flag generated debug output for a class like:

[DEBUG] * WEB-INF / classes / MyPackage / MyClass.class is updated.

I think I also had the same problem before the file that was cached (?) Was an incomplete compiler from Eclipse, causing "Unresolved compilation problems" errors from the Maven assembly, but a working artifact from the Eclipse export.

  • How does Maven determine if the file is โ€œupdatedโ€ during the install process?
  • Where are Maven files compared to?
  • Can I get Maven to create a package from scratch?
  • Any other ideas would be appreciated!
+3
source share
1 answer

So far, I have decided that the Updated .class file is created in the target directory, and that the class with the same name in the .war release is not the same (different date modified, different size)

, target\classes, target.

  • Maven ?

,

mvn clean install

clean ( target) .

- Maven. , webapp, src/main/webapp/WEB-INF/classes

+8

Source: https://habr.com/ru/post/1755305/


All Articles