Maven 1.x Artifact Plugin
  1. Maven 1.x Artifact Plugin
  2. MPARTIFACT-49

pom:install should produce a temporary standalone POM to copy to repo

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently, pom:install does a file copy to the local repo. This has multiple problems.

      • Entities are not resolved, and entity imports are not copied.
      • Extends path can be relative, which makes it nearly impossible to use the pom in a meaningful way without also finding it's parent (usually the only way to resolve ../project.xml would be to do an scm checkout; but that info is in the pom that won't parse).

      I propose the following:

      prior to the file copy inside pom:install and pom:deploy, there should be a prereq="pom:generate-standalone" which would literally take the Project instance in memory and serialize it to a temporary project.xml (let's say target/project.xml or something). The pom:install and pom:deploy goals would then copy that file to the repo rather than the original project.xml file.

      It would:

      • Remove the extends element, because the Project instance is the result of any merges
      • Remove the issue of discorporeal entities, since entity resolution would have happened before parsing the project.xml at the beginning of pom:xxx

      I think this is still logically valid, since any pom in the repo is considered an artifact, and should be able to stand on it's own without complex interpretation. It would also be easy to do with xstream or any other type of xml serialization...even xpp3's XmlSerializer could do it, and the code to do so would be of minimal size.

        Issue Links

          Activity

          Hide
          Julien Kirch added a comment -

          Seems to be a sequel of MAVEN-1390 .

          Show
          Julien Kirch added a comment - Seems to be a sequel of MAVEN-1390 .
          Hide
          John Casey added a comment -

          seems like a better long-term solution than the doco upgrade to me...thought we should talk about it, so I put them both out there (one before this occurred to me, the second this one).

          Show
          John Casey added a comment - seems like a better long-term solution than the doco upgrade to me...thought we should talk about it, so I put them both out there (one before this occurred to me, the second this one).
          Hide
          Felipe Leme added a comment -

          I was going to open a similar issue, as sometimes we have JEXL/EL expressions on the POM that should be resolved before being the POM is deployed.

          Take for instance the Cactus plugin:

          <dependency>
          <groupId>cactus</groupId>
          <artifactId>cactus</artifactId>
          <version>13-$

          {pom.currentVersion}

          </version>
          </dependency>

          I could start the work on the "pom:generate-standalone" task, so it would resolve the EL expressions, but I wouldn't be able to solve the XML issues (I don't know how to do it and it would take to much time to figure it out).

          – Felipe

          Show
          Felipe Leme added a comment - I was going to open a similar issue, as sometimes we have JEXL/EL expressions on the POM that should be resolved before being the POM is deployed. Take for instance the Cactus plugin: <dependency> <groupId>cactus</groupId> <artifactId>cactus</artifactId> <version>13-$ {pom.currentVersion} </version> </dependency> I could start the work on the "pom:generate-standalone" task, so it would resolve the EL expressions, but I wouldn't be able to solve the XML issues (I don't know how to do it and it would take to much time to figure it out). – Felipe

            People

            • Assignee:
              Brett Porter
              Reporter:
              John Casey
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: