Problem with using Parent POMs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with using Parent POMs

Nelligan, Steven M

 

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 | [hidden email]
www.fs.illinois.edu
 
facebook    twitter    instagram    youtube     

https://webtools.illinois.edu/webservices/js/ds/signature_logo.png

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: [hidden email]
For additional commands, e-mail: [hidden email]

pom.xml (18K) Download Attachment
ParentPom.xml (1K) Download Attachment
Execution.txt (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with using Parent POMs

Andy Feldman
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 <[hidden email]> 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 | [hidden email]
www.fs.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: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Problem with using Parent POMs

Nelligan, Steven M

 

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 | [hidden email]
www.fs.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 <[hidden email]>
Sent: Tuesday, September 3, 2019 11:05 PM
To: Maven Users List <[hidden email]>
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 <[hidden email]> 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 | [hidden email]
www.fs.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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with using Parent POMs

Jason Young
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 <[hidden email]>
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 | [hidden email]
> 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 <[hidden email]>
> *Sent:* Tuesday, September 3, 2019 11:05 PM
> *To:* Maven Users List <[hidden email]>
> *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 <[hidden email]>
> 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 | [hidden email]
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>