You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Nelligan, Steven M" <sn...@illinois.edu> on 2019/09/03 23:42:26 UTC

Problem with using Parent POMs

I am trying implement a parent POM in my project tree.
Project Tree:
C:/
                Dev/
                                Projects/
                                   ParentPom.xml
                                Dor-enterprise/                                <one of many projects at this level>
                                   Pom.xml
                                   Src/


Attached is the parentPom, pom, and the log of the execution when I run from Dor-enterprise

C:\dev\Projects\dor-enterprise>mvn -PvDev CLEAN INSTALL SITE -e -X

I have never tried to use parent pom's before and may be trying to use them incorrectly.

Any help would be apprecrated,
Steven M Nelligan
APPLICATION DEVELOPER

Facilities and Services
Information Technology Services
University of Illinois at Urbana-Champaign
Facilities and Services
1501 S. Oak Street | M/C 800
Champaign, IL 61820
217.244.8097 | other: 217.244.8097 | snelliga@illinois.edu<ma...@illinois.edu>
www.fs.illinois.edu<http://www.fs.illinois.edu/>

[facebook]<https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [twitter] <https://twitter.com/UofIFS>     [instagram] <https://www.instagram.com/uofifs/>     [youtube] <https://www.youtube.com/user/UofIFS>

[https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]<http://illinois.edu/>

Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure.


Re: Problem with using Parent POMs

Posted by Jason Young <ja...@procentive.com>.
One thing to remember that makes Maven make sense is this: As you would
expect, Maven doesn't scan your whole SSD for pom.xml files or jars, but
rather looks in the _current reactor_ (look up multi-module projects for
details), then in your private repo, and finally in whatever external repo
you have configured (e.g. maybe your company's Nexus repo, or Maven Central
by default). It looks up dependency artifacts by group id, artifact id,
version, and a few other things (not always present because they have
default values). Just because a project is present on your filesystem as
part of a multi-project doesn't mean it will be part of the build; you have
to tell Maven what you want.

As a convenience, you may optionally provide a parent pom filepath,
relative to the path of the child pom, to tell Maven to go ahead and read
that file when building the child instead of looking to the repo, etc., but
the parent's GAV coordinates are required in case that file isn't there,
i.e. you're always allowed to use means outside of Maven to _inject_
dependencies of various kinds: so-called "dependencies", plugin
dependencies, and parents. (But no one does that because changing files to
inject dependencies is a pain.)

Beware that the parent-child relationship is one concept, but the
multi-module / reactor idea is something entirely different, even though
many Maven users and even some official plugins conflate the two. It is
highly conventional therefore to make a multi-module project also the
parent of its modules (though it's also conventional to have a parent pom
without modules).

On Wed, Sep 4, 2019 at 9:02 AM Nelligan, Steven M <sn...@illinois.edu>
wrote:

>
>
> This information and a little tweaking, I got it to work.
>
>
>
> Thank you for your help.
>
>
>
> *Steven M Nelligan*
> *APPLICATION DEVELOPER*
>
>
> Facilities and Services
>
> Information Technology Services
> University of Illinois at Urbana-Champaign
> Facilities and Services
> 1501 S. Oak Street | M/C 800
> Champaign, IL 61820
> 217.244.8097 | *other*: 217.244.8097 | snelliga@illinois.edu
> www.fs.illinois.edu
>
> [image: facebook]
> <https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [image:
> twitter] <https://twitter.com/UofIFS>    [image: instagram]
> <https://www.instagram.com/uofifs/>    [image: youtube]
> <https://www.youtube.com/user/UofIFS>
>
> [image: https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]
> <http://illinois.edu/>
>
> *Under the Illinois Freedom of Information Act any written communication
> to or from university employees regarding university business is a public
> record and may be subject to public disclosure.*
>
>
>
> *From:* Andy Feldman <an...@wealthfront.com>
> *Sent:* Tuesday, September 3, 2019 11:05 PM
> *To:* Maven Users List <us...@maven.apache.org>
> *Subject:* Re: Problem with using Parent POMs
>
>
>
> If I interpreted this setup correctly, the easiest solution would be to
> rename ParentPom.xml to just Pom.xml, and change the version of the
> dependency from 0.0.1-20190903.165620-1 to 0.0.1-SNAPSHOT, to match what's
> in the parent pom. That should be sufficient, since the parent folder is
> the default location to check for the parent pom, and Pom.xml is the
> default filename. Alternatively, I would expect it to work if you specified
> <relativePath>../ParentPom.xml</relativePath>.
>
>
>
> This is covered in the documentation for Project Inheritance here:
> https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance
>
>
>
> Where did you get the version 0.0.1-20190903.165620-1 from? Is the parent
> artifact already published to a Maven repo? In that case, you would instead
> want <relativePath/>, which tells it to look in a repo for the parent.
>
>
>
> Hope that helps,
>
> --
>
> Andy Feldman
>
>
>
> On Tue, Sep 3, 2019 at 4:42 PM Nelligan, Steven M <sn...@illinois.edu>
> wrote:
>
>
>
> I am trying implement a parent POM in my project tree.
>
> Project Tree:
>
> C:/
>
>                 Dev/
>
>                                 Projects/
>
>                                    ParentPom.xml
>
>
> Dor-enterprise/                                <one of many projects at
> this level>
>
>                                    Pom.xml
>
>                                    Src/
>
>
>
>
>
> Attached is the parentPom, pom, and the log of the execution when I run
> from Dor-enterprise
>
>
>
> C:\dev\Projects\dor-enterprise>mvn -PvDev CLEAN INSTALL SITE -e -X
>
>
>
> I have never tried to use parent pom’s before and may be trying to use
> them incorrectly.
>
>
>
> Any help would be apprecrated,
>
> *Steven M Nelligan
> *
> *APPLICATION DEVELOPER*
>
>
> Facilities and Services
>
> Information Technology Services
> University of Illinois at Urbana-Champaign
> Facilities and Services
> 1501 S. Oak Street | M/C 800
> Champaign, IL 61820
> 217.244.8097 | *other*: 217.244.8097 | snelliga@illinois.edu
> www.fs.illinois.edu
>
> [image: facebook]
> <https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [image:
> twitter] <https://twitter.com/UofIFS>    [image: instagram]
> <https://www.instagram.com/uofifs/>    [image: youtube]
> <https://www.youtube.com/user/UofIFS>
>
> [image: https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]
> <http://illinois.edu/>
>
> *Under the Illinois Freedom of Information Act any written communication
> to or from university employees regarding university business is a public
> record and may be subject to public disclosure.*
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Problem with using Parent POMs

Posted by "Nelligan, Steven M" <sn...@illinois.edu>.
This information and a little tweaking, I got it to work.

Thank you for your help.

Steven M Nelligan
APPLICATION DEVELOPER

Facilities and Services
Information Technology Services
University of Illinois at Urbana-Champaign
Facilities and Services
1501 S. Oak Street | M/C 800
Champaign, IL 61820
217.244.8097 | other: 217.244.8097 | snelliga@illinois.edu<ma...@illinois.edu>
www.fs.illinois.edu<http://www.fs.illinois.edu/>

[facebook]<https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [twitter] <https://twitter.com/UofIFS>     [instagram] <https://www.instagram.com/uofifs/>     [youtube] <https://www.youtube.com/user/UofIFS>

[https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]<http://illinois.edu/>

Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure.

From: Andy Feldman <an...@wealthfront.com>
Sent: Tuesday, September 3, 2019 11:05 PM
To: Maven Users List <us...@maven.apache.org>
Subject: Re: Problem with using Parent POMs

If I interpreted this setup correctly, the easiest solution would be to rename ParentPom.xml to just Pom.xml, and change the version of the dependency from 0.0.1-20190903.165620-1 to 0.0.1-SNAPSHOT, to match what's in the parent pom. That should be sufficient, since the parent folder is the default location to check for the parent pom, and Pom.xml is the default filename. Alternatively, I would expect it to work if you specified <relativePath>../ParentPom.xml</relativePath>.

This is covered in the documentation for Project Inheritance here: https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance

Where did you get the version 0.0.1-20190903.165620-1 from? Is the parent artifact already published to a Maven repo? In that case, you would instead want <relativePath/>, which tells it to look in a repo for the parent.

Hope that helps,
--
Andy Feldman

On Tue, Sep 3, 2019 at 4:42 PM Nelligan, Steven M <sn...@illinois.edu>> wrote:

I am trying implement a parent POM in my project tree.
Project Tree:
C:/
                Dev/
                                Projects/
                                   ParentPom.xml
                                Dor-enterprise/                                <one of many projects at this level>
                                   Pom.xml
                                   Src/


Attached is the parentPom, pom, and the log of the execution when I run from Dor-enterprise

C:\dev\Projects\dor-enterprise>mvn -PvDev CLEAN INSTALL SITE -e -X

I have never tried to use parent pom’s before and may be trying to use them incorrectly.

Any help would be apprecrated,
Steven M Nelligan
APPLICATION DEVELOPER

Facilities and Services
Information Technology Services
University of Illinois at Urbana-Champaign
Facilities and Services
1501 S. Oak Street | M/C 800
Champaign, IL 61820
217.244.8097 | other: 217.244.8097 | snelliga@illinois.edu<ma...@illinois.edu>
www.fs.illinois.edu<http://www.fs.illinois.edu/>

[facebook]<https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [twitter] <https://twitter.com/UofIFS>     [instagram] <https://www.instagram.com/uofifs/>     [youtube] <https://www.youtube.com/user/UofIFS>

[https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]<http://illinois.edu/>

Under the Illinois Freedom of Information Act any written communication to or from university employees regarding university business is a public record and may be subject to public disclosure.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<ma...@maven.apache.org>
For additional commands, e-mail: users-help@maven.apache.org<ma...@maven.apache.org>

Re: Problem with using Parent POMs

Posted by Andy Feldman <an...@wealthfront.com>.
If I interpreted this setup correctly, the easiest solution would be to
rename ParentPom.xml to just Pom.xml, and change the version of the
dependency from 0.0.1-20190903.165620-1 to 0.0.1-SNAPSHOT, to match what's
in the parent pom. That should be sufficient, since the parent folder is
the default location to check for the parent pom, and Pom.xml is the
default filename. Alternatively, I would expect it to work if you specified
<relativePath>../ParentPom.xml</relativePath>.

This is covered in the documentation for Project Inheritance here:
https://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance

Where did you get the version 0.0.1-20190903.165620-1 from? Is the parent
artifact already published to a Maven repo? In that case, you would instead
want <relativePath/>, which tells it to look in a repo for the parent.

Hope that helps,
--
Andy Feldman

On Tue, Sep 3, 2019 at 4:42 PM Nelligan, Steven M <sn...@illinois.edu>
wrote:

>
>
> I am trying implement a parent POM in my project tree.
>
> Project Tree:
>
> C:/
>
>                 Dev/
>
>                                 Projects/
>
>                                    ParentPom.xml
>
>
> Dor-enterprise/                                <one of many projects at
> this level>
>
>                                    Pom.xml
>
>                                    Src/
>
>
>
>
>
> Attached is the parentPom, pom, and the log of the execution when I run
> from Dor-enterprise
>
>
>
> C:\dev\Projects\dor-enterprise>mvn -PvDev CLEAN INSTALL SITE -e -X
>
>
>
> I have never tried to use parent pom’s before and may be trying to use
> them incorrectly.
>
>
>
> Any help would be apprecrated,
>
> *Steven M Nelligan
> *
> *APPLICATION DEVELOPER*
>
>
> Facilities and Services
>
> Information Technology Services
> University of Illinois at Urbana-Champaign
> Facilities and Services
> 1501 S. Oak Street | M/C 800
> Champaign, IL 61820
> 217.244.8097 | *other*: 217.244.8097 | snelliga@illinois.edu
> www.fs.illinois.edu
>
> [image: facebook]
> <https://www.facebook.com/UniversityOfIllinoisFacilitiesServices>    [image:
> twitter] <https://twitter.com/UofIFS>    [image: instagram]
> <https://www.instagram.com/uofifs/>    [image: youtube]
> <https://www.youtube.com/user/UofIFS>
>
> [image: https://webtools.illinois.edu/webservices/js/ds/signature_logo.png]
> <http://illinois.edu/>
>
> *Under the Illinois Freedom of Information Act any written communication
> to or from university employees regarding university business is a public
> record and may be subject to public disclosure.*
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org