Tag Archives: maven package error

[Solved] Maven Package Error: Error assembling JAR

Cause of the problem
the jar package prompted is occupied by other programs, so it is impossible to repackage and replace the old package

Solution:
1. If the jar package can be run, check whether the jar package is running and end the corresponding process
2. Check whether the read-write permission of the jar package has been changed and give the file read-write permission before operation
3. Check whether other software is editing the jar package file (such as compression software) and exit editing

Maven package error: [WARNING] The POM for xxx is missing, no dependency inform

When maven install or package, execute warning and error:

[WARNING] The POM for com.xx-base:jar:1.0 is missing, no dependency information available

[ERROR] Failed to execute goal on project xx-mobi: Could not resolve dependencies for project com.xx-mobi:jar:1.0: Failed to collect dependencies at xx-base:jar:1.0: Failed to read artifact descriptor for xx- base:jar:1.0: Could not find artifact xx-root:pom:1.0 in geotoolrepo…

 

This is because the sub-modules of the maven project did not execute the public modules first when performing installation and packaging related operations. That is, the project has a public module xx-base; the current module that needs to be executed is xx-mobi, then you should install xx-base first, and then perform xx-mobi related operations.

Scenes

As shown in the following figure, a multi-module project created using Maven, a wa-servicemodule, a wa-appmodule, the wa-appmodule depends on the wa-servicemodule, and they are all WebAppDemosub-modules.

Error reporting and analysis

  • Perform packaging for the wa-app module and report [WARNING] The POM for com.mxc:wa-service:jar:1.0-SNAPSHOT is missing, no dependency information available , and the packaging fails.
  • According to the above error message, the preliminary analysis is that the jar package of the dependent wa-service module is not found in the warehouse . So I thought of installing the wa-service module first , and then packaging the wa-app module, but the result is still [WARNING] The POM for com.mxc:wa-service:jar:1.0-SNAPSHOT is missing, no dependency information available , the reason is unknown.

solve

Solution: first execute the install package installation on the parent module WebAppDemo , and then package the wa-app module.
Note: Pack and install the parent module, and all the sub-modules under it will be packaged and installed at the same time. For the above project, after the parent module is packaged and installed, the files of the three modules after packaged and installed can be found in the local warehouse.

Failed to execute goal on project XXXX-api: Could not resolve dependencies for pro

Failed to execute goal on project XXXX-api: Could not resolve dependencies for pro***************************************************

today met a maven packaging error, an error message that Could not resolve dependencies for pro * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

the reason is that the package name path was modified during the migration of the module. Try all kinds of cleanup and finally mention cleanup top level pom. XML

in a know reply

execute maven clean, then execute maven install and then repackage the specified module.

if the package is still wrong, please carefully check the reference package path and the real module package path are consistent;