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

More lenient handling of empty Maven modules #103

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

nikita2206
Copy link
Contributor

@nikita2206 nikita2206 commented Nov 5, 2024

📜 Description

Maven allows for empty modules to exist, e.g. you can have a Maven module without any Java sources in it.
This is especially common in multi-module projects, where the root module has no sources at all, but only contains children modules; thus the root module does not contain the src/main/java directory.

Our use case

Maven supports inheritance of plugins, that is in multi-module project you can declare a plugin (using <plugins><plugin> .... </plugins>) in the root pom.xml and then this definition will be inherited by all children modules. This would allow us to declare the Sentry plugin only once in the root pom.xml, and have it be inherited in all children.

However, this does not work, because our root pom.xml is an empty module without Java sources, and currently Sentry plugin fails in these circumstances.

💡 Motivation and Context

Allow more convenient use of Sentry plugin in multi-module Maven deployments.

💚 How did you test it?

🔧 Manually tested -> works as expected with a multi-module projects

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

@nikita2206 nikita2206 marked this pull request as ready for review November 5, 2024 12:18
Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR, I think this makes sense! @adinauer wdyt?

@adinauer
Copy link
Member

Thanks for the PR @nikita2206 I'm still occupied with preparing another release of the Java SDK but am planning to take a look at this PR soon - sorry for the wait.

@nikita2206
Copy link
Contributor Author

Thank you all!

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR

@adinauer adinauer merged commit 3a08f22 into getsentry:main Nov 13, 2024
6 checks passed
adinauer pushed a commit that referenced this pull request Jan 27, 2025
#skip-changelog

## 📜 Description
add integration test for PR #103


## 💡 Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->


## 💚 How did you test it?


## 📝 Checklist
<!--- Put an `x` in the boxes that apply -->
- [ ] I reviewed the submitted code
- [ ] I added tests to verify the changes
- [ ] I updated the docs if needed
- [ ] No breaking changes


## 🔮 Next steps
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

Successfully merging this pull request may close these issues.

3 participants