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

brp-java-repack-jars still running despite setting rpmBrpJavaRepackJars to false #789

Closed
jjunqueira opened this issue May 11, 2016 · 6 comments · Fixed by #932
Closed

brp-java-repack-jars still running despite setting rpmBrpJavaRepackJars to false #789

jjunqueira opened this issue May 11, 2016 · 6 comments · Fixed by #932
Projects

Comments

@jjunqueira
Copy link

Hi,

This is related to this http://stackoverflow.com/questions/36940733/sbt-native-packager-rpm-brp-java-repack-jars-still-running-despite-setting-rpmbr question.

I was asked to open an issue referencing this https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala#L112.

Let me know if I can provide any more information.

@muuki88
Copy link
Contributor

muuki88 commented May 11, 2016

Awesome, thanks :)

Let me know if I can provide any more information

A pull request would be the only thing left to do ;)

thetristan pushed a commit to thetristan/sbt-native-packager that referenced this issue Jun 26, 2016
thetristan pushed a commit to thetristan/sbt-native-packager that referenced this issue Aug 1, 2016
@YuvalItzchakov
Copy link
Contributor

YuvalItzchakov commented Aug 4, 2016

I've tried using both the mentioned workaround (http://stackoverflow.com/a/36966909/1870803) and using rpmBrpJavaRepackJars := false with sbt-native-packager 1.1.0-RC and 1.1.1. Both are being ignored during rpm packaging and I still see brp-java-repack-jars being ran.

Am I missing something?

lazy val rpmBuildSettings = Seq(
  rpmPrefix := Some(defaultLinuxInstallLocation.value),

  linuxPackageSymlinks := Seq.empty,
  defaultLinuxLogsLocation := defaultLinuxInstallLocation.value + "/" + name.value,

  rpmBrpJavaRepackJars in Rpm := false,
  rpmBrpJavaRepackJars := false,

  //64bit architecture
  packageArchitecture in Rpm := "x86_64",

  //name of the package will be as the project name (defined in project's build.sbt)
  packageName in Rpm := s"${name.value}",

  //Start of FAT jar configuration

  // we specify the name for our fat jar
  assemblyJarName := s"${name.value}_${version.value}.jar",
  // the bash scripts classpath only needs the fat jar
  scriptClasspath := Seq(assemblyJarName.value),

  // removes all jar mappings in universal and appends the fat jar
  mappings in Universal := {
    // universalMappings: Seq[(File,String)]
    val universalMappings = (mappings in Universal).value
    val fatJar = (assembly in Compile).value

    // removing means filtering
    val filtered = universalMappings filter {
      case (file, fileName) => !fileName.endsWith(".jar")
    }

    filtered :+ fatJar -> ("lib/" + fatJar.getName)
  },
  //End of FAT jar configuration

  //Takes the application.conf file from resources and puts it in conf folder during installation
  mappings in Universal += {

    val resources = (resourceDirectory in Compile).value
    val conf = resources / "application.conf"
    conf -> "conf/application.conf"
  }
)

@muuki88
Copy link
Contributor

muuki88 commented Aug 5, 2016

Thanks for your report. Try the following to verify that this is an issue with native-packager

  1. Build your rpm with rpm:packageBin
  2. Open the spec file in the /target/rpm/.... It must include
%define __os_install_post \
%{_rpmconfigdir}/brp-compress \
%{!?__debug_package:%{_rpmconfigdir}/brp-strip %{__strip}} \
%{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
%{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}

which gets inserted here ( source )

If this is all okay, can you add some information of your build system?

  • OS
  • rpm version

cheers,
Muki

muuki88 pushed a commit that referenced this issue Aug 5, 2016
* Fix scoping in RPM plugin for #789

* Update simple-rpm test to check contents of spec file

* Add checks for additional fields used to build rpmspec
@jannylund
Copy link

The problem is that the setting is actually inversed (as suggested here #199 (comment) )

Setting rpmBrpJavaRepackJars in Rpm := true will skip the repackaging, but documentation refers to setting it to false for skipping.

@mr-git
Copy link
Contributor

mr-git commented Jan 13, 2017

are there any plans to fix this issue?

@muuki88
Copy link
Contributor

muuki88 commented Jan 14, 2017

hi @mr-git

A pull request would be the only thing left to do ;)

If you have the time to fix this, I'm happy to merge it :)

YuvalItzchakov pushed a commit to YuvalItzchakov/sbt-native-packager that referenced this issue Jan 18, 2017
muuki88 pushed a commit that referenced this issue Jan 25, 2017
* Fixed issue #789 where brpJavaRepack was negated (set to 'false' instead of 'true')

* 1. Changed brpJavaRepack command to a supported flag on RPM
2. Changed the default of repack from true to false, which means repack will not run by default.

* 1. Removed debug logs
2. Added a test to make sure java repack is ran when set to `true`.

* Triggering rebuild.

* Modified RPM names to avoid race conditions and failing tests.

* Fixed broken tests (missing renaming in places, comments).

* Updated RPM repacking description in the docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Rpm
Bugs
Development

Successfully merging a pull request may close this issue.

5 participants