jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1
  • MAVEN-1390

POM example <extends> doco is non-portable

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

In the documentation for the POM, the example includes:

<extends>${basedir}/../project.xml</extends>

which will wreak havoc on any attempts to use the pom without having the parent project's files on hand. This means that this pom is next to useless, unless we can first checkout the parent project from scm or somesuch. The scm info is in the POM, so you see a circle beginning to emerge...

We should change this example to be:

<extends>${maven.repo.local}/${pom.groupId}/poms/${pom.id}-${pom.currentVersion}.pom</extends>

where all pom.* values are filled in manually with the actual values.

Issue Links

is depended upon by

Task - A task that needs to be done. NANO-135 M2 compatibility

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.
is related to

New Feature - A new feature of the product, which has yet to be developed. MAVEN-1393 Add the possibility to use parent pom present in repo

  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

New Feature - A new feature of the product, which has yet to be developed. MAVEN-699 add a posibility to extend a project by specifying it's groupId, artifactId and version

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. MPARTIFACT-49 pom:install should produce a temporary standalone POM to copy to repo

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Joerg Schaible added a comment - 23/Jul/04 4:56 AM

And how would you develop in a multiproject? If someone checks out from the repository, he has no "parent" pom in the local repo, nor is it copied there.

Show
Joerg Schaible added a comment - 23/Jul/04 4:56 AM And how would you develop in a multiproject? If someone checks out from the repository, he has no "parent" pom in the local repo, nor is it copied there.
Hide
Permalink
Trygve Laugstol added a comment - 23/Jul/04 9:18 AM

I don't think we should change the behaviour of maven that much. We could enforce the idea that John Casey came up with when uploading artifacts so that the <extend> element it changes to the form that was suggested.

Show
Trygve Laugstol added a comment - 23/Jul/04 9:18 AM I don't think we should change the behaviour of maven that much. We could enforce the idea that John Casey came up with when uploading artifacts so that the <extend> element it changes to the form that was suggested.
Hide
Permalink
Brett Porter added a comment - 23/Jul/04 10:51 AM

Joerg: it's chicken and the egg. If we add a dependency to the project it would be downloaded, but dependencies aren't done until the extended element is read.

That issue would need to be resolved some way.

Show
Brett Porter added a comment - 23/Jul/04 10:51 AM Joerg: it's chicken and the egg. If we add a dependency to the project it would be downloaded, but dependencies aren't done until the extended element is read. That issue would need to be resolved some way.
Hide
Permalink
Joerg Schaible added a comment - 23/Jul/04 11:01 AM

Brett: Then why not deploy the resolved POM? No expand problem, no entity headache and anything is included and does not have to reference any external file.

Show
Joerg Schaible added a comment - 23/Jul/04 11:01 AM Brett: Then why not deploy the resolved POM? No expand problem, no entity headache and anything is included and does not have to reference any external file.
Hide
Permalink
Brett Porter added a comment - 23/Jul/04 11:11 AM

not compatible with the long term goal of building the structure from POMs that reside in the repository.

Show
Brett Porter added a comment - 23/Jul/04 11:11 AM not compatible with the long term goal of building the structure from POMs that reside in the repository.
Hide
Permalink
Joerg Schaible added a comment - 23/Jul/04 11:34 AM

But then you have to prevent people using entities or properties in a POM at all:

<version>&my-comp-version;</version>

is as evil than

<version>${my.comp.version}</version>

Maybe it's just me, but I cannot follow the argumentation. Why does a resolved POM (i.e. no external references at all and all inherited tags embedded) interfere with that long term goal? The deployed POM would contain any information.

Show
Joerg Schaible added a comment - 23/Jul/04 11:34 AM But then you have to prevent people using entities or properties in a POM at all: <version>&my-comp-version;</version> is as evil than <version>${my.comp.version}</version> Maybe it's just me, but I cannot follow the argumentation. Why does a resolved POM (i.e. no external references at all and all inherited tags embedded) interfere with that long term goal? The deployed POM would contain any information.
Hide
Permalink
Joerg Schaible added a comment - 23/Jul/04 11:58 AM

duplicated now by MPPOM-4 and would also resolve MPPOM-1

Show
Joerg Schaible added a comment - 23/Jul/04 11:58 AM duplicated now by MPPOM-4 and would also resolve MPPOM-1
Hide
Permalink
Brett Porter added a comment - 23/Jul/04 12:08 PM

that's a tangent to the original issue.

Yes, entities should be resolved if they are supported.

Show
Brett Porter added a comment - 23/Jul/04 12:08 PM that's a tangent to the original issue. Yes, entities should be resolved if they are supported.
Hide
Permalink
John Casey added a comment - 23/Jul/04 12:18 PM

Even if we're writing a clean, "standalone" pom to the repo, there is still the portability question for the sources themselves.

A good example of the failing of ../project.xml is in the old jakarta-commons stuff. It's not like this anymore, but it used to be that you had to co the entire jarkarta-commons module (or at least the root of the module) in order to build any of the subprojects. This is simply an unwieldy way of doing things, and should be discouraged regardless of what we decide to do with pom:install and pom:deploy.

Entities should be left out of the equation IMO, but they are currently the best solution in some cases, and if you're bent on using them then the entity definition file should be in the project root, because this file will not be deployed to any repo and will lead to the extends problem all over again if in ../deps.ent f.e. However, if you follow that rule, then all should be well with entities.

We should also be dealing with "best practices" relating to entities in the doco, once we get MPPOM-4 figured out. I know some people hate the idea of using entities, but they're the cleanest solution without having transitive dep resolution in place. Instead of banning them, and dealing with a "black market" we need to address them and state a concrete position and usage rule in the documentation - legalize and tax, so to speak.

These issues - MPPOM-4 and this one - are not in competition, I think, but complementary.

Show
John Casey added a comment - 23/Jul/04 12:18 PM Even if we're writing a clean, "standalone" pom to the repo, there is still the portability question for the sources themselves. A good example of the failing of ../project.xml is in the old jakarta-commons stuff. It's not like this anymore, but it used to be that you had to co the entire jarkarta-commons module (or at least the root of the module) in order to build any of the subprojects. This is simply an unwieldy way of doing things, and should be discouraged regardless of what we decide to do with pom:install and pom:deploy. Entities should be left out of the equation IMO, but they are currently the best solution in some cases, and if you're bent on using them then the entity definition file should be in the project root, because this file will not be deployed to any repo and will lead to the extends problem all over again if in ../deps.ent f.e. However, if you follow that rule, then all should be well with entities. We should also be dealing with "best practices" relating to entities in the doco, once we get MPPOM-4 figured out. I know some people hate the idea of using entities, but they're the cleanest solution without having transitive dep resolution in place. Instead of banning them, and dealing with a "black market" we need to address them and state a concrete position and usage rule in the documentation - legalize and tax, so to speak. These issues - MPPOM-4 and this one - are not in competition, I think, but complementary.
Hide
Permalink
Arik Kfir added a comment - 08/Aug/04 12:29 PM

I disagree. I wouldn't ban entities, but I think the correct solution to project inheritance is stating its parent project group+artifact IDs. Something like:
<project>
<extend>
<groupId>parentProjectGroup</groupId>
<artifactId>parentProjectArtifact</artifactId>
<version>not sure about this...</version>
</extend>
...
</project>

I believe a POM should be composed of a single file - it is not a source code that can use "#include" statements (borrowing some c syntax : it is a POM. A descriptor. Something else, and should be contained so that it can be passed around freely. It CAN however contain links to other "beings" such as dependencies, parent projects, etc.

Anyway, that's how we view things over here, and frankly, we'd hate maven to ignore this issue and simply solve it by using entities - we would love to see some sort of declarative inheritance in maven - it's like a big chunk of a puzzle...

Cheers..

Show
Arik Kfir added a comment - 08/Aug/04 12:29 PM I disagree. I wouldn't ban entities, but I think the correct solution to project inheritance is stating its parent project group+artifact IDs. Something like: <project> <extend> <groupId>parentProjectGroup</groupId> <artifactId>parentProjectArtifact</artifactId> <version>not sure about this...</version> </extend> ... </project> I believe a POM should be composed of a single file - it is not a source code that can use "#include" statements (borrowing some c syntax : it is a POM. A descriptor. Something else, and should be contained so that it can be passed around freely. It CAN however contain links to other "beings" such as dependencies, parent projects, etc. Anyway, that's how we view things over here, and frankly, we'd hate maven to ignore this issue and simply solve it by using entities - we would love to see some sort of declarative inheritance in maven - it's like a big chunk of a puzzle... Cheers..
Hide
Permalink
Brett Porter added a comment - 05/Oct/05 8:52 PM

now that we deploy the resolved pom, this is unnecessary for that use case.

It's still an issue for checking out projects in isolation, but the feature is present in m2.

Show
Brett Porter added a comment - 05/Oct/05 8:52 PM now that we deploy the resolved pom, this is unnecessary for that use case. It's still an issue for checking out projects in isolation, but the feature is present in m2.

People

  • Assignee:
    Unassigned
    Reporter:
    John Casey
Vote (2)
Watch (5)

Dates

  • Created:
    22/Jul/04 12:29 PM
    Updated:
    08/Mar/06 10:46 PM
    Resolved:
    05/Oct/05 8:52 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.