Hi:

 

I am new to Maven so this issue is probably due to a misunderstanding on my
part so any help would be greatly appreciated.

 

I have a multi-level project structure (4 levels) i.e.

 

applications--> common --> server --> project 1

                                                               ...

                                                       --> project n

 

                                       --> client  -->  project 1

                                                                ...

                                                       --> project m

 

       

Each project (lowest level) produces a jar file so the packaging in each of
their pom files is set to jar. There is a pom file at each level whose
packaging is set to pom so that I can inherit settings and plugins at each
level from the level above. Everything works fine when I am at the project
(i.e. lowest) level in my tree. 

 

If however, I am at, say the server level (one level up from the project
level) and I want to do a 'mvn package' to package all of the projects
underneath I get the following error message:

 

GroupId: applications

ArtifactId: common

Version: 1.0-SNAPSHOT

 

Reason: Unable to download the artifact from any repository

 

  applications:common:pom:1.0-SNAPSHOT

 

from the specified remote repositories:

  central (http://repo1.maven.org/maven2)

 

 

[INFO]
------------------------------------------------------------------------

[INFO] Trace

org.apache.maven.reactor.MavenExecutionException: Cannot find parent:
applications:common for project: applications.common:server:pom:1.0-SNAPSHOT

        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:278)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:25)

        at java.lang.reflect.Method.invoke(Method.java:585)

        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)

        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)

        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

 

This kind of makes sense, since the packaging for the pom file at this level
is not going to create anything to be placed in the repository, or does it? 

 

How can I achieve what I am trying to do? i.e while at any level be able to
run mvn on all levels underneath when the pom at the level I'm working at has
a parent? In my first iteration I only had 2 levels and I was able to run mvn
at the top level for the level underneath.

 

Thanks in advance for any help of references to examples of what I am trying
to do.

 

Tom.

 

 

 

 

Tom Hurley

Senior Lead Developer

Insighful Corp

1700 Westlake Ave N., #500

Seattle, WA 98109

(Work): 206-283-8802 x369

(Fax): 206-283-8691

(Cell): 206-661-6930

 

 

Reply via email to