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

Allow disabling the plugin using the comand line #60

Closed
vigenere23 opened this issue Mar 11, 2024 · 2 comments · Fixed by #65
Closed

Allow disabling the plugin using the comand line #60

vigenere23 opened this issue Mar 11, 2024 · 2 comments · Fixed by #65
Labels
enhancement New feature or request Platform: Java

Comments

@vigenere23
Copy link

Problem Statement

Maybe it's moe of a problem from Maven's end, but let's say you want to dockerize a project that is configured to upload Sentry source bundles, but you don't have a sentry Auth key or want to provide one during the image build, it would be nice to not have to mingle with the pom.xml configuration and simply be able to pass either an env variable or a property to disable the plugin.

Solution Brainstorm

  • Have the plugin check for an env-variable and/or a system property before executing, thus allowing it to be disabled dynamically.
@vigenere23 vigenere23 added enhancement New feature or request Platform: Java labels Mar 11, 2024
@adinauer
Copy link
Member

Hello @vigenere23, you could add a

    <properties>
		...
        <sentry.skip>false</sentry.skip>
    </properties>

and use that in our block like:

...
		<skip>${sentry.skip}</skip>
    </configuration>
</plugin>

Then when running the command you could do something like ./mvnw package -Dsentry.skip=true.

Using <sentry.skip>${env.SENTRY_SKIP}</sentry.skip> enable/disable Sentry via the SENTRY_SKIP environment variable.

@vigenere23
Copy link
Author

Yes that's the solution I have seen. I was more wondering about the case were we do not own the pom.xml and thus have to find a way that does not require it to change. Is that more of a convention problem with Maven and how the tools are generaly made?

adinauer added a commit that referenced this issue Mar 25, 2024
## 📜 Description
<!--- Describe your changes in detail -->
Allow disabling source upload via `SENTRY_SKIP_SOURCE_UPLOAD` env var.

## 💡 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. -->
Fixes #60

Source upload requires an auth token and fails the build without a valid
one. This allows disabling source upload without changing `pom.xml`

## 💚 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
enhancement New feature or request Platform: Java
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants