maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Heinz Marbaise (Jira)" <j...@apache.org>
Subject [jira] [Commented] (MNG-6455) ci-friendly version in parent pom displays build warning in child project
Date Tue, 04 Aug 2020 11:11:00 GMT

    [ https://issues.apache.org/jira/browse/MNG-6455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17170724#comment-17170724
] 

Karl Heinz Marbaise commented on MNG-6455:
------------------------------------------

Based on the given example you are using {{mvn install}} where [in the documentation|https://maven.apache.org/maven-ci-friendly.html#install-deploy]
explicitly stated that if you use {{install/deploy}} you *have to* configure the {{flatten-maven-plugin}}
which is responsible to resolve the special properties. Otherwise it will not work. 
The example for {{parent-pom}} does not contain a configuration for {{flatten-maven-plugin}}
which will result in such issues.

If you have *not* configured {{flatten-maven-plugin}} you can take a look into the installed
{{parent-pom.xml}} which looks like this:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>parent-pom</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <properties>
        <revision>1.0.0-SNAPSHOT</revision>
    </properties>
...
{code}
If you have configured {{flatten-maven-plugin}} the result in the {{parent-pom.xml}} you have
installed looks like this:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>parent-pom</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <properties>
    <revision>1.0.0-SNAPSHOT</revision>
  </properties>
..
{code}

> ci-friendly version in parent pom displays build warning in child project
> -------------------------------------------------------------------------
>
>                 Key: MNG-6455
>                 URL: https://issues.apache.org/jira/browse/MNG-6455
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Robert Thornton
>            Priority: Minor
>         Attachments: mng-6455.zip
>
>
> I have a project that is using a parent project with ci-friendly versions, but while
Maven is scanning for projects, it is looking for "my-parent-$%7Brevision%7D.pom" instead
of "my-parent-1.0-a8e435".  The project builds, but a warning is printed which confuses some
of the teams using my parent pom.
> {{[INFO] Scanning for projects...}}
> {{Downloading from mvn-lds: https://code.myserver.org/artifactory/mvn-repo/my/stack/platform/my-parent/$%7Brevision%7D/my-parent-$%7Brevision%7D.pom}}
> {{[WARNING] Failed to build parent project for my.stack.platform:my-project:pom:4.8.2.RELEASE}}
>  
> I've tracked the issue down to DefaultProjectBuilder, line 671 where `project.getParentArtifact()`
is returning an Artifact object with the unresolved version.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message