Skip to content
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

Move expression: {blah} no value System.out to logs #1119

Merged

Conversation

JackPGreen
Copy link
Contributor

When running the versions:set goal, the console is full of expression: {blah} no value messages.

Further investigation identified this occurs when a pom contains a property declared in a parent pom.

In PomHelper#getRawModel:

* Gets the raw model before any interpolation what-so-ever.

As such the parent properties are no longer accessible downstream.

Based on this, being unable to evaluate an expression is not unexpected and does not need to appear in any non-debug log.

This can be reproduced with a parent:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.me</groupId>
    <artifactId>parent</artifactId>
    <packaging>pom</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <scala.version>2.13</scala.version>
    </properties>
</project>

And root:

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.me</groupId>
        <artifactId>parent</artifactId> 
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>parent/pom.xml</relativePath>
    </parent>
    <artifactId>root</artifactId>
    <packaging>pom</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <modules>
        <module>parent</module>
    </modules>
    <properties>
        <generateBackupPoms>false</generateBackupPoms>
        <newVersion>123</newVersion>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_${scala.version}</artifactId>
            <version>3.6.1</version>
        </dependency>
    </dependencies>
</project>

@slawekjaranowski slawekjaranowski added this to the next-release milestone Jul 19, 2024
@slawekjaranowski slawekjaranowski merged commit 403775d into mojohaus:master Aug 29, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants