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

Added Profile dependency migration #4310

Closed

Conversation

marcel-gepardec
Copy link
Contributor

Profile dependency migration

What's changed?

Dependencies can now be migrated within the profile section whether there are inside of a dependencyManagement section or declared as normal dependencies. That's why profile dependency validations are now added to the MavenVisitor class.

Example:

Before:

...
<profiles>
        <profile>
            <id>test</id>
            <dependencies>
                <dependency>
                    <groupId>javax.persistence</groupId>
                    <artifactId>javax.persistence-api</artifactId>
                    <version>2.2</version>
                </dependency>
            </dependencies>
        </profile>
</profiles>
...

After:

...
<profiles>
        <profile>
            <id>test</id>
            <dependencies>
                <dependency>
                    <groupId>jakarta.persistence</groupId>
                    <artifactId>jakarta.persistence-api</artifactId>
                    <version>3.2.0</version>
                </dependency>
            </dependencies>
        </profile>
</profiles>
...

What's your motivation?

A question was posted on slack by @ErhardSiegl referring the not migrating dependencies inside profiles.
Regarding this problem I took the initiative and implemented it.

Have you considered any alternatives or workarounds?

While working on this topic, I noticed a missing recipe for plugins and profiles. While it is possible to add profiles or change plugin dependencies, there are no options to change a dependency groupId, artifactId, or version within plugins or profiles separately. Just a heads up, maybe consider implementing a recipe to be able to change this in the future.

@timtebeek
Copy link
Contributor

Thanks a lot! I've pushed some minor changes up to #4311 as I can't push to this pull request. Should be good to merge soon.

@timtebeek timtebeek self-requested a review July 9, 2024 10:55
@timtebeek timtebeek added the enhancement New feature or request label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants