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

Support Reading <configuration> Tag from settings.xml in MavenMojoProjectParser.buildSettings() so that config like connection timeout can be passed to rewrite-maven module #829

Open
skazaruddin opened this issue Aug 3, 2024 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@skazaruddin
Copy link

skazaruddin commented Aug 3, 2024

Description:

Currently, the rewrite-maven module does not support server configuration details from the tag in the settings.xml file because the MavenMojoProjectParser class in the "rewrite-maven-plugin" does not read this configuration while creating the MavenSettings object before setting the MavenExecutionContextView. As a result, during runtime the operations that depend on these configurations do not function as expected, even though the "rewrite-maven" module has unit tests for it. e.g. reading timeouts from the tag.

Link to the Code:

Proposed Enhancement:

Enhance the MavenMojoProjectParser.buildSettings() method to read and incorporate the <configuration> tag from the settings.xml file while creating the MavenSettings object. This will ensure that all server configurations, including timeouts specified in the tag, are correctly utilized at runtime.

@skazaruddin skazaruddin added the enhancement New feature or request label Aug 3, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Aug 3, 2024
@timtebeek timtebeek changed the title Support Reading <configuration> Tag from settings.xml in MavenMojoProjectParser.buildSettings() so that config like connection timeout can be passed to rewrite-maven module Support Reading <configuration> Tag from settings.xml in MavenMojoProjectParser.buildSettings() so that config like connection timeout can be passed to rewrite-maven module Aug 7, 2024
@timtebeek
Copy link
Contributor

timtebeek commented Aug 7, 2024

hi! We ought to be parsing the configured timeout after this PR

Note that we do not support all configuration options there, but a singular <timeout> should work. Is that not working for you?

Proactively closing this issue; let me know if I misunderstood & we'll reopen!
A clear example of what input ought to be parsed if not already ought to help then.

@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenRewrite Aug 7, 2024
@skazaruddin
Copy link
Author

Hi @timtebeek , It's not working for me and the reason is the "rewrite-maven-plugin" is not reading the <timeout> from <configuration> tag inside <server> tag in settings.xml. Ideally, the MavenMojoParser should read the timeout field, then create ServerConfiguration object and pass it in below mentioned line, so that the Server object in MavenSettings will the timeout value.

Then, the pull request will work fine, as it will receive, the MavenSettings object with timeout value inside Configuration object.

@timtebeek timtebeek reopened this Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in OpenRewrite Aug 8, 2024
@timtebeek
Copy link
Contributor

Thanks for the feedback. Perhaps an example file or even a PR that fixes this could help then, as I'm still a bit confused.

@timtebeek timtebeek moved this from In Progress to Backlog in OpenRewrite Aug 19, 2024
@timtebeek timtebeek added the question Further information is requested label Oct 16, 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 question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

2 participants