Thanks Wayne that did the trick! Sameh
-----Original Message----- From: Wayne Fay [mailto:[EMAIL PROTECTED] Sent: Friday, June 01, 2007 12:50 PM To: Maven Users List Subject: Re: Dependency and groupId? Here's my critiques of your poms: parent: looks ok common add <groupId>com.fairisaac.mbpa</groupId> after <modelVersion/> add <version>7.0</version> after <name/> add <packaging>jar</packaging> after <version/> dataaccess add <groupId>com.fairisaac.mbpa</groupId> after <modelVersion/> add <version>7.0</version> after <name/> Probably, the only thing you really absolutely need is the <packaging/> element in common. Finally, you need to run "mvn install" from the top level/parent directory before it will succeed from any of the subdirectories. Wayne On 6/1/07, Tawfik, Sameh E <[EMAIL PROTECTED]> wrote: > > > Hi Wayne, > > I'm using "Better Builds With Maven", and I followed the example in > chapter 3, but I still get the same error! I must be missing something > or not set something correctly? But, I'm not sure what? > > Attached are my three pom files, the parent and the two sub ones. I made > copies and renamed them, so it would be easy to differentiate them. > > I think the source of this problem is following code that I copied from > the manual and added it to the parent pom file: > > This is from the manual, "For example, you may want to configure the > Java compiler to allow JDK 5.0 sources. This is as simple as adding the > following to your POM:" > > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-compiler-plugin</artifactId> > <version>2.0</version> > <configuration> > <source>1.5</source> > <target>1.5</target> > </configuration> > </plugin> > </plugins> > </build> > > If I remove the above code, I got compilation errors. The interesting > issue, that same code does not cause any problem, when I build the first > module? > > As I specified before, I can build the first module with no problem, but > when I try to build the second module that depends on the jar of the > first build module, it fails with the following error: > > C:\SVN_DB\MBPA\mbpa-dataaccess_impl>mvn install > [INFO] Scanning for projects... > [INFO] > ------------------------------------------------------------------------ > ---- > [INFO] Building mbpa-dataaccess_impl > [INFO] task-segment: [install] > [INFO] > ------------------------------------------------------------------------ > ---- > [INFO] [resources:resources] > [INFO] Using default encoding to copy filtered resources. > Downloading: > http://repo1.maven.org/maven2/com/fairisaac/mbpa/mbpa/7.0/mbpa-7.0.pom > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to resolve artifact. > > GroupId: com.fairisaac.mbpa > ArtifactId: mbpa > Version: 7.0 > > Reason: Unable to download the artifact from any repository > > com.fairisaac.mbpa:mbpa:pom:7.0 > > from the specified remote repositories: > central (http://repo1.maven.org/maven2) > > > Thanks, > > Sameh > > > -----Original Message----- > From: Wayne Fay [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 31, 2007 6:13 PM > To: Maven Users List > Subject: Re: Dependency and groupId? > > You pick your own groupId for all your own projects. We generally > suggest the groupId be basically your domain backwards -- a.b.com > becomes com.b.a. > > In this case, I would probably use com.fairisaac.mbpa as the groupId > for my artifacts, as it seems like mbpa is perhaps your project name. > Then I would use artifactId values like mcd, dataaccess-impl, etc. > > If you don't specify a groupId, Maven assumes > org.apache.maven.plugins. This is why you're running into these > problems. > > You should probably read the Better Builds With Maven free PDF since > it sounds like you're just starting out with Maven2 -- it covers a lot > of these introductory topics. > > Wayne > > On 5/31/07, Tawfik, Sameh E <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm using Maven version: 2.0.6. > > > > My project has few modules; I created the parent pom.xml file, and > > pom.xml for each module. > > > > I'm able to compile the first module, but when I try to compile the > > second module that depends on the first module jar file, I get the > > following error: > > > > [INFO] Building mbpa-dataaccess_impl > > [INFO] task-segment: [compile] > > [INFO] > > > ------------------------------------------------------------------------ > > ---- > > [INFO] [resources:resources] > > [INFO] Using default encoding to copy filtered resources. > > Downloading: > > > http://repo1.maven.org/maven2/org/apache/maven/plugins/mcd/7.0/mcd-7.0.p > > om > > [INFO] > > > ------------------------------------------------------------------------ > > [ERROR] BUILD ERROR > > [INFO] > > > ------------------------------------------------------------------------ > > [INFO] Failed to resolve artifact. > > > > GroupId: org.apache.maven.plugins > > ArtifactId: mcd > > Version: 7.0 > > > > Reason: Unable to download the artifact from any repository > > > > org.apache.maven.plugins:mcd:pom:7.0 > > > > from the specified remote repositories: > > central (http://repo1.maven.org/maven2) > > > > Whatever value I set for the gorupId, when I try to compile maven > > attempts to download the needed .pom file, and it fails? > > > > So, I'm not sure what to set the goupId to? And how to make maven > > reference the jar that was built when it compiled the first module? > > > > groupId - This element indicates the unique identifier of the > > organization or group that created the project. The groupId is one of > > the key identifiers of a project and is typically based on the fully > > qualified domain name of your organization. For example > > org.apache.maven.plugins is the designated groupId for all Maven > > plugins. > > > > Can someone let me know what I'm missing or doing wrong? > > > > Thanks, > > > > Sameh > > This email and any files transmitted with it are confidential, > proprietary > > and intended solely for the individual or entity to whom they are > addressed. > > If you have received this email in error please delete it immediately. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > This email and any files transmitted with it are confidential, proprietary > and intended solely for the individual or entity to whom they are addressed. > If you have received this email in error please delete it immediately. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
