-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin does not evaluate GroupId / ArtifactId property variables #1001
Comments
I'll look into it. |
Strangely enough, so far I haven't been able to reproduce the issue. I tried this test scenario: <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>localhost</groupId>
<artifactId>it-display-dependency-updates-issue-1001-groupid</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<description>groupId is expressed via a Maven property</description>
<properties>
<dep.groupId>localhost</dep.groupId>
<dep.version>1.0</dep.version>
</properties>
<dependencies>
<dependency>
<groupId>${dep.groupId}</groupId>
<artifactId>dummy-api</artifactId>
<version>${dep.version}</version>
</dependency>
</dependencies>
</project>
def output = new File(basedir, "output.txt").text
assert output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*\Q1.0\E\s+->\s+\Q3.0\E\b/ and it passes with the relevant log lines:
I've also tried adding a real dependency to a real-life project (module versions-maven-plugin in the versions-maven-plugin project): <properties>
<dep.groupId>com.google.guava</dep.groupId>
<dep.version>16.0</dep.version>
</properties>
<dependencies>
<!-- project dependencies -->
<dependency>
<groupId>${dep.groupId}</groupId>
<artifactId>guava</artifactId>
<version>${dep.version}</version>
</dependency> Using the following command: mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:display-dependency-updates -pl :versions-maven-plugin produced the following output:
|
It looks like this does work fine (i.e. bug can't be reproduced) with 2.16.0. Could you please isolate a test project (that is, a minimal pom.xml) which does verify the issue? NB. The goal does not use raw POM files, it gets project information from Maven with all property variables already interpolated (resolved) by Maven. |
@Tholian - can you help a reproduce issue?, as you see we can not reproduce it @ajarmoniuk - we can add simple IT to confirm case |
@Tholian we add a test to confirm that working as expected |
Hi, I have tried to set up a test project as an example of the behavior I have seen. But indeed this is working fine. I will try to figure out what causes this misbehavior. |
If th groupId of an dependency is defined in a property and this property-variable is used in the dependency the execution of
mvn versions:display-dependency-updates
shows some problems.eg. following pom.xml snippet
will lead to this console output:
[INFO] --- versions-maven-plugin:2.16.0:display-dependency-updates (default-cli) @ myProject---
Downloading from nexus: http://myNexusRepo/nexus/content/groups/public/$%7BarchunitGroupId%7D/archunit/maven-metadata.xml
As you can see, the GroupId was not correctly determined.
Excpected behaviour is a correct usage of variables even for groupId an artifactId.
The text was updated successfully, but these errors were encountered: