can't resolve another child project when running mvn tomcat:run
I开发者_开发百科'm developing a maven project with following structure:
main // project which packaging is pom
|-- datalevel-project
|-- service-project
`-- web-ui-project
I'm trying to run project on tomcat but when I command mvn tomcat:run
on the folder of main project I get an error while it is building the service-project:
Failed to resolve artifact.
Missing:
1) datalevel-project:jar:0.0.1-SNAPSHOT
and so on..
I have set all child projects to main project with module
tag and all child projects have parent and its relativePath
to ../main
project.
Can somebody tell me where is the problem??
Firstly, dependencies are resolved through your local repository. Did you install
(in maven sense) the datalevel-project (and other artifacts) to your repository? I suggest to run mvn install
on your main project to build and install everything first.
Secondly, why do you run mvn tomcat:run
on the aggregator pom (the main project)? I'd expect this goal to be called on a project with a packaging of type war
(the web-ui-project).
Thirdly, I have a doubt about the way you declared the relativePath
. Given your project structure, it should be ../pom.xml
which is actually the default value so you could omit it (providing relevant pom snippets would help).
精彩评论