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

How to change version information of managed dependencies #38

Open
nuvitong opened this issue Jul 27, 2017 · 0 comments
Open

How to change version information of managed dependencies #38

nuvitong opened this issue Jul 27, 2017 · 0 comments

Comments

@nuvitong
Copy link

nuvitong commented Jul 27, 2017

Hi,

I'm currently evaluating the pom-explorer, if we could manage our multi-repository, multi-module project with it. So far I'm very pleased.

Currently I'm stuck with changing dependency versions of a managed dependency, where the version is set as property.

Imagine the following dependency declaration:

(The junit dependency is just an example to get the point. in the case of our project, this would be an internal dependency, where the dependency management POM is imported within a parent project.)

<properties>
    <junit.version>4.11</junit.version>
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>
</dependencies>

Now I'd like to change the version of the dependency using the a ProjectChange:

ProjectChange dependencyChange = ProjectChange.setDependency(
        project, DependencyKey.parse("junit:junit"), "version", "4.12");

I would expect the current value of the dependency version to be ${junit.version}, which would then be processed by the FollowVariableProcessor. Please find attached an IntegrationTest and the according POM. (Those have to be contained within the same package, so that the test finds the POM.)

The actual value seems to be null, as the managed dependencies are not evaluated by the ProjectChange.

So my question is: is this kind of Dependency Change supported by pom-explorer so far?

Thanks in advance for your support.

ProjectWithDependencyManagementIT.java.txt
project-with-dependency-management-pom.xml.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant