maven publish: env variables enforced that are not needed
See original GitHub issueHey,
I’m not entirely sure if this is the right place to report the issue. Let me know if it should be elsewhere.
The generated publish:maven
step (i assume its coming from: https://github.com/projen/projen/blob/63f89f0d7adbc853a2caeac16de63cac75e257be/src/release/publisher.ts#L246)
is generating a section in tasks.json
like this:
"publish:maven": {
"name": "publish:maven",
"description": "Publish this package to Maven Central",
"env": {
"MAVEN_ENDPOINT": "https://myscustomurl.com",
"MAVEN_REPOSITORY_URL": "https://myscustomurl.com"
},
"requiredEnv": [
"MAVEN_GPG_PRIVATE_KEY",
"MAVEN_GPG_PRIVATE_KEY_PASSPHRASE",
"MAVEN_PASSWORD",
"MAVEN_USERNAME",
"MAVEN_STAGING_PROFILE_ID"
],
"steps": [
{
"exec": "npx -p jsii-release@latest jsii-release-maven"
}
]
},
This results in
🤖 missing required environment variables: MAVEN_GPG_PRIVATE_KEY,MAVEN_GPG_PRIVATE_KEY_PASSPHRASE,MAVEN_PASSWORD,MAVEN_USERNAME,MAVEN_STAGING_PROFILE_ID
when running npx projen publish:maven
This does not work for repositories where not maven central is used, and only there the GPG signing is supported.
the publish works perfectly fine when setting the env vars manually, eg like that:
export MAVEN_ENDPOINT="https://myscustomurl.comrepository/maven/",
export MAVEN_REPOSITORY_URL="https://myscustomurl.com/repository/maven-releases/"
export MAVEN_SERVER_ID="nexus"
export MAVEN_USERNAME="foobar"
export MAVEN_PASSWORD="CHANGEME"
npx -p jsii-release@latest jsii-release-maven
But fails as soon any of the GPG variables is set:
export MAVEN_GPG_PRIVATE_KEY="sfhgjk"
❌ Package signing is currently only supported for Maven Central
projen version: 0.30.5
tl;dr:
Is there an option to not make the gpg env variables mandatory for the npm publish step?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Apache Maven Enforcer Built-In Rules – Require Environment ...
This rule checks that a specified environment variable is set. The following parameters are supported by this rule: message - an optional ...
Read more >How to identify and set a missing environment property in ...
If you want to make sure that the property value is ALWAYS supplied on a command line, then you can use maven-enforcer-plugin. Here...
Read more >Maven Enforcer Plugin - Baeldung
With the requireEnvironmentVariable rule, we can ensure that a certain environment variable is set in the execution environment. It can be ...
Read more >Maven packages in the Package Registry - GitLab Docs
Publish Maven artifacts in your project's Package Registry. Then, install the packages whenever you need to use them as a dependency.
Read more >Environment variables not picked up by signing plugin #149
Caused by: org.gradle.api.InvalidUserDataException: Cannot perform signing task ':interactor:signMavenPublication' because it has no configured signatory at ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue is now marked as stale because it hasn’t seen activity for a while. Add a comment or it will be closed soon.
Closing this issue as it hasn’t seen activity for a while. Please add a comment @mentioning a maintainer to reopen.