You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Markus Bollerey (JIRA)" <ji...@codehaus.org> on 2015/01/23 00:18:17 UTC
[jira] (MSHARED-408) EmbeddedMavenModelExposer ignores parent
values in pom
Markus Bollerey created MSHARED-408:
---------------------------------------
Summary: EmbeddedMavenModelExposer ignores parent values in pom
Key: MSHARED-408
URL: https://jira.codehaus.org/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 two 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:
NEW: // read parent values first
NEW: identification.addAndSetGroupId(model.getParent().getGroupId());
NEW: identification.addAndSetVersion(model.getParent().getVersion());
OLD: identification.addAndSetGroupId(model.getGroupId());
OLD: identification.addAndSetArtifactId(model.getArtifactId());
OLD: identification.addAndSetVersion(model.getVersion());
OLD: identification.addAndSetName(model.getName());
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)