简体   繁体   中英

Maven artifact not uploaded with pom file

I have a backend multimodule maven project, that is build on jenkins with mvn clean package command (maven version 3.3). After a sucessfull build I upload two of the maven subprojects target/*.jar to private nexus (using Nexus artifact uploader plugin). The jars from target folders are uploaded correctly, but the pom is not (there is no option in the plugin to upload the pom).

Then I have my webapp project, where I have dependency to the two artifacts on my private nexus. They are found and downloaded, but not the pom. Building the webapp project fails, because the dependencies are not resolved for the two jars. A warning is printed out during build:

[WARNING] The POM for <groupId>:<submodule-artifactId>:jar:1.0.0 is missing, no dependency information available

That is reasonable - I can clearly see in nexus repository that it has only jar, md5 and sha files. How should I build my multimodule maven project in a way I would be able to reference only submodules in my webapp project? Or should I upload the submodule projects poms manualy?

I am open to upload the whole backend project to nexus, but I would like to be able to add only subprojects as dependencies to my webapp.

Since you are using a private nexus, you need to specify in your maven where to look for your artifact. Usually the way to do it is to specify a repository configuration in your pom.xml as specified in this link . This will tell maven to contact your private nexus for your artifacts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM