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

Snapshot builds fail RPM packaging #175

Closed
2 of 5 tasks
ilacc1 opened this issue Mar 23, 2022 · 3 comments
Closed
2 of 5 tasks

Snapshot builds fail RPM packaging #175

ilacc1 opened this issue Mar 23, 2022 · 3 comments
Labels
bug Something isn't working fixed Issue fixed and release pending

Comments

@ilacc1
Copy link

ilacc1 commented Mar 23, 2022

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:
Hi there, and many thanks for a great tool.

I need a little help. My RPM packaging fails for SNAPSHOT versions. My project uses java conventions which contain hyphen character in version - e.g. 0.3.4-SNAPSHOT. This trips up RPM packager which doesn't allow hyphens in version. Is there a way to deal with this?

Steps to reproduce the issue/enhancement:

  1. Take any example project and set version to 1.0.0-SNAPSHOT
  2. Try to build RPM package

What is the expected behavior?
Maybe for RPM packages we could replace hyphen with underscore?

What is the current behavior?
RPM part of the build fails.

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?
Build log has this exception trace:

java.lang.IllegalArgumentException: version with value: '0.3.4-SNAPSHOT' contains illegal character -
    at org.redline_rpm.Builder.checkVariableContainsIllegalChars (Builder.java:329)
    at org.redline_rpm.Builder.setPackage (Builder.java:347)
    at org.redline_rpm.Builder.setPackage (Builder.java:359)
    at io.github.fvarrui.javapackager.packagers.GenerateRpm.doApply (GenerateRpm.java:57)
    at io.github.fvarrui.javapackager.packagers.GenerateRpm.doApply (GenerateRpm.java:22)
    at io.github.fvarrui.javapackager.packagers.ArtifactGenerator.apply (ArtifactGenerator.java:44)
    at io.github.fvarrui.javapackager.packagers.Packager.generateInstallers (Packager.java:435)
    at io.github.fvarrui.javapackager.maven.PackageMojo.execute (PackageMojo.java:371)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
...

What is the motivation / use case for changing the behavior?
RPM builds for snapshots should work?

Please tell us about your environment:

  • JavaPackager version: 1.6.0
  • OS version: Rocky Linux 8.5
  • JDK version: 11
  • Build tool:
    • Maven
    • Gradle

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

@fvarrui
Copy link
Owner

fvarrui commented Mar 23, 2022

Hi @ilacc1!
I've managed to reproduce your issue and it's fixed in issue-175 branch (JavaPackager 1.6.6.-SNAPSHOT). Please, test it and give some feedback.

String version = packager.getVersion().replaceAll("-", "_");

Thanks!

@fvarrui fvarrui added the bug Something isn't working label Mar 23, 2022
@ilacc1
Copy link
Author

ilacc1 commented Mar 24, 2022

Yep, fixed. Incredibly quick turnaround. Many thanks Francisco!

Ivan

@fvarrui
Copy link
Owner

fvarrui commented Mar 25, 2022

I'll release JavaPackager 1.6.6 to Maven Central ASAP.
Thanks!

@fvarrui fvarrui added the fixed Issue fixed and release pending label Mar 25, 2022
@ilacc1 ilacc1 closed this as completed Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue fixed and release pending
Projects
None yet
Development

No branches or pull requests

2 participants