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

Unable to publish RPM for a Play 2.4 app #706

Closed
umatrangolo opened this issue Nov 30, 2015 · 3 comments
Closed

Unable to publish RPM for a Play 2.4 app #706

umatrangolo opened this issue Nov 30, 2015 · 3 comments
Labels
documentation Documentation should be extended or updated rpm

Comments

@umatrangolo
Copy link
Contributor

Hi,

I was trying to publish an RPM for my Play 2.4 app with no success. It is a toy app to play with Play and Native Packager but I'm not able to publish its RPM :/

This is the build.sbt:

import gilt.sbt.resolvers.GiltRepos

name := """play-greeter"""
version := "0.0.1"
lazy val root = (project in file(".")).enablePlugins(PlayScala, RpmPlugin)
scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  jdbc,
  cache,
  ws,
  specs2 % Test
)

// publish configuration for Nexus                                                     
publishTo := Some(GiltRepos.Resolvers.head)
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
publishMavenStyle := false

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

// Play provides two styles of routers, one expects its actions to be injected, the     
// other, legacy style, accesses its actions statically.                                                                                                                  
routesGenerator := InjectedRoutesGenerator

// RPM generation                                                                       
maintainer in Linux := "Ugo Matrangolo <[email protected]>"
packageSummary in Linux := "Greeter Service Installation"
packageDescription := "Simple service to greet someone the morning"
rpmRelease := "1"
rpmVendor := "Ugo Matrangolo"
rpmUrl := Some("http://umatrangolo.com")
rpmLicense := Some("Apache v2")
rpmGroup := Some("TEST")
rpmBrpJavaRepackJars := true

And the following is the output of the 'sbt rpm:publish' task:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0

[info] Loading project definition from /Users/umatrangolo/Development/sandbox/play greeter/project
[info] Set current project to play-greeter (in build file:/Users/umatrangolo/Development/sandbox/play-greeter/)
[info] Updating {file:/Users/umatrangolo/Development/sandbox/play-greeter/}root...
[info] Wrote /Users/umatrangolo/Development/sandbox/play-greeter/target/scala-2.11/play-greeter_2.11-0.0.1.pom
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] :: delivering :: play-greeter#play-greeter_2.11;0.0.1 :: 0.0.1 :: release :: Mon Nov 30 13:15:48 GMT 2015
[info]  delivering ivy file to /Users/umatrangolo/Development/sandbox/play-greeter/target/scala-2.11/ivy-0.0.1.xml
[info]  published play-greeter_2.11 to https://nexus.gilt.com/nexus/content/repositories/internal-releases/play-greeter/play-greeter_2.11/0.0.1/play-greeter_2.11-0.0.1.pom
[info]  published play-greeter_2.11 to https://nexus.gilt.com/nexus/content/repositories/internal-releases/play-greeter/play-greeter_2.11/0.0.1/play-greeter_2.11-0.0.1.jar
[info]  published play-greeter_2.11 to https://nexus.gilt.com/nexus/content/repositories/internal-releases/play-greeter/play-greeter_2.11/0.0.1/play-greeter_2.11-0.0.1-sources.jar
[info]  published play-greeter_2.11 to https://nexus.gilt.com/nexus/content/repositories/internal-releases/play-greeter/play-greeter_2.11/0.0.1/play-greeter_2.11-0.0.1-javadoc.jar
[success] Total time: 8 s, completed 30-Nov-2015 13:15:55

All the usual Jars got published correctly but no trace of the RPM. Running 'sbt rpm:packageBin' works perfectly.

What am I missing ?? :)

Best

@fiadliel
Copy link
Contributor

Please try adding the UniversalDeployPlugin AutoPlugin, see http://www.scala-sbt.org/sbt-native-packager/topics/deployment.html#default-configuration

Alternatively, you can use makeDeploymentSettings(Rpm, packageBin in Rpm, "rpm") as described further down on that page.

Does this work for you?

@umatrangolo
Copy link
Contributor Author

Amended with:

lazy val root = (project in file(".")).enablePlugins(PlayScala, RpmPlugin, UniversalDeployPlugin)

with no result.

The following worked though:

lazy val root = (project in file(".")).settings(makeDeploymentSettings(Rpm, packageBin in Rpm, "rpm")).enablePlugins(PlayScala, RpmPlugin)

So, I think the documentation here is a bit lacking: the above is not stated as mandatory and it looks like it is something that you use only in particular circumstances (the par is called 'Custom Configuration').

The 'Default configuration' part is not working at all (at least for a Play proj).

Thank you :)

@muuki88 muuki88 added rpm documentation Documentation should be extended or updated labels Dec 1, 2015
@muuki88
Copy link
Contributor

muuki88 commented Dec 1, 2015

@umatrangolo The reason the first solution doesn't work is, that then UniversalDeployPlugin is enabled, but you are actually build an rpm. You have to use the RpmDepolyPlugin.

lazy val root = (project in file("."))
   .enablePlugins(PlayScala, RpmPlugin, RpmDeployPlugin)

When you take a look at the second code snippet your are enabling the deployment settings for the Rpm scope.

Could you open a PR fixing this in the docs?

@muuki88 muuki88 closed this as completed Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation should be extended or updated rpm
Projects
None yet
Development

No branches or pull requests

3 participants