maven install times COMPILATION ERROR package does not exist

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \******\TEST.java:[15,29] Package org.jboss.ws.tools.ant does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.315s
[INFO] Finished at: Sun Apr 07 19:08:43 CST 2013
[INFO] Final Memory: 21M/147M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project UmeServerCore: Compilation failure: Compilation failure:

 

    No error was reported during the first build install, indicating success.

    At this time, I found that I forgot to upgrade the pom version, so I just modified the version number under the pom.

    Repeated build and install again reported the above error. Tried project clean, maven clean can't get rid of this error.

    

    Analyze the error message.

    First of all, I definitely don't use this package, so it makes no sense to report "package does not exist".

    Try to find ideas from the classes given in the error message. Click in and find that there is indeed an import statement that refers to org.jboss.ws.tools.ant. 

    But there is a yellow mark of never used. The guess is that other colleagues did not delete the redundant import statement after modifying the code.

    Ctrl + Shift + o to remove all redundant import references.

    Build install again and the error disappears.

 

    NOTE: For problems like this, it is difficult to find standard solutions online. After all, everyone's situation is different. I solved it this way, it may not help others. However, you can try it.

 

 

-----

EDIT:

Recently, it was found that maven build install directly after maven-clean always reported similar errors of missing packages or missing classes

You can try project clean 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327103180&siteId=291194637