You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2015/12/26 00:53:49 UTC
[jira] [Commented] (MSHARED-408) EmbeddedMavenModelExposer ignores
parent values in pom
[ https://issues.apache.org/jira/browse/MSHARED-408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15071761#comment-15071761 ]
Michael Osipov commented on MSHARED-408:
----------------------------------------
I'd like to take on this, can you please provide a unified patch and a test case? I will apply your change.
> EmbeddedMavenModelExposer ignores parent values in pom
> ------------------------------------------------------
>
> Key: MSHARED-408
> URL: https://issues.apache.org/jira/browse/MSHARED-408
> Project: Maven Shared Components
> Issue Type: Bug
> Components: maven-shared-jar
> Affects Versions: maven-shared-jar-1.1
> Environment: not depending on environment
> Reporter: Markus Bollerey
> Priority: Minor
>
> Many Maven archives define a parent in their pom and leave values of groupId and/or version to parent. Consequently they then do not define explicit values for groupId and/or version again.
> Because this exposer implementation does not read parent values, it often finds no groupId and/or version where in Maven terms is one defined (in the parent).
> Solution:
> Just add the following six lines of code ('NEW') to the existing four lines ('OLD') adding values to the <identification> instance. Don't remove any of the existing code, just insert the new ones before as shown:
> NEW1: // read parent values first
> NEW2: if (model.getParent() != null) {
> NEW3:
> NEW4: identification.addAndSetGroupId(model.getParent().getGroupId());
> NEW5: identification.addAndSetVersion(model.getParent().getVersion());
> NEW6: }
> OLD1: identification.addAndSetGroupId(model.getGroupId());
> OLD2: identification.addAndSetArtifactId(model.getArtifactId());
> OLD3: identification.addAndSetVersion(model.getVersion());
> OLD4: identification.addAndSetName(model.getName());
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)