简体   繁体   中英

Add a Maven Project as a depdendency to a Java Web Project in NetBeans

I have an existing Java / Maven project, which does not have an ANT build script. I would like to use this project as a dependency in a Java Web Project in NetBeans. When I try to add the project, as a library, I get the message:

"This project cannot be added because it does not produce a JAR file using an Ant script."

I can obviously output a JAR and link that in, but I would like Netbeans to ensure that when I build my Web project, my dependent project also gets built if necessary.

Maybe there is some Ant wrapper for maven?

To be clear this is a java web project (not maven) which depends on a java project (with maven)

Looks like there is a plugin for maven to do this.

http://maven.apache.org/plugins/maven-ant-plugin/index.html

You should add the maven project's local repository jar as the Ant project dependency. You will have to build each project separately but apart from that things should be working fine.

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