Skip to content

Support for .mvn/maven.config #462

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

Closed
fabapp2 opened this issue Oct 5, 2022 · 1 comment · Fixed by #468
Closed

Support for .mvn/maven.config #462

fabapp2 opened this issue Oct 5, 2022 · 1 comment · Fixed by #468
Labels
type: enhancement New feature or request
Milestone

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Oct 5, 2022

What needs to be done

Maven can be configured using a file .mvn/maven.config to define system parameters which will be passed to every mvn command.

Why it needs to be done

In CWA-Server a property revision is defined in pom.xmls.
This property needs to be resolved using OpenRewrite.
Looking into getPom().getValue(...) showed that only some standard properties are resolved by their keys and if these are not found it's looked up using System.getProperty().
The simplest way to allow a lookup using getValue() would be to add all system properties defined in .mvn/maven.config as system properties during parsing.

Acceptance Criteria

Given

.mvn/maven.config

-Dsome.property=some-value

pom.xml

<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>example.com</groupId>
    <artifactId>module</artifactId>
    <version>0.1.0</version>
    <properties>
        <resolved.value>${some.property}</resolved.value>
    </properties>
</project>

When

  • The pom was parsed

Then

  • The property resolved.value should have the value some-value

Additional Information

@fabapp2 fabapp2 added the type: enhancement New feature or request label Oct 5, 2022
@fabapp2
Copy link
Contributor Author

fabapp2 commented Oct 5, 2022

assigned-to: @sanagaraj-pivotal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant