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

Usage with Play 2.3: Assets are not part of application artifact #362

Closed
mavilein opened this issue Sep 24, 2014 · 4 comments
Closed

Usage with Play 2.3: Assets are not part of application artifact #362

mavilein opened this issue Sep 24, 2014 · 4 comments
Labels

Comments

@mavilein
Copy link

We are using sbt-native-packager within our Play application. It worked fine with Play version 2.2. Today we upgraded to Play 2.3 to use the new asset pipeline. However when the application artifact is built no jar for the web assets is generated. If i run the dist task from sbt, i don't see the assets jar in the target directory. But if i remove the rpm plugin, the dist task succesfully creates this jar.

I am unsure wether this might be a misconfiguration on our side or if it's a bug. :)

@muuki88 muuki88 added the bug label Sep 24, 2014
@muuki88
Copy link
Contributor

muuki88 commented Sep 24, 2014

Can you post a minimal build.sbt to reproduce this? Do you use the shipped version of sbt-native-packager (if yes, try upgrading to 0.8.0-M1 and see if the error still occurs).

@mavilein
Copy link
Author

This is my current minimal build.sbt, which reproduces this issue in a freshly created play project created with the activator (Play 2.3.4):

import RpmPackage.rpmSettings

name := """asset-test"""

version := "1.0-SNAPSHOT"

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

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  ws
)

rpmSettings

And RpmPackage.scala is placed within the project directory:

import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.SbtNativePackager._
import sbt._
import sbt.Keys._
import scala.Some

object RpmPackage {
  lazy val rpmSettings = packageArchetype.java_server ++ deploymentSettings ++ Seq(

    defaultLinuxInstallLocation := "/opt",

    daemonUser := "product-page",

    daemonGroup := "product-page",

    maintainer := "[email protected]",

    makeEtcDefault := Some(baseDirectory.value / "conf" / "environment.conf"),

    version in Rpm := version.value.replaceAll("-", "_"),

    rpmVendor in Rpm := organizationName.value,

    rpmLicense in Rpm := Some(organizationName.value),

    packageSummary in Rpm := "product page service",

    packageDescription in Rpm :=
      """product page""",

    packageArchitecture in Rpm := "x86_64",

    rpmPre in Rpm := Option(
      """
        |%define __os_install_post    \
        |    /usr/lib/rpm/brp-compress \
        |    %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
        |    /usr/lib/rpm/brp-strip-static-archive %{__strip} \
        |    /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
        |%{nil}
      """.stripMargin
    ),

    rpmPost in Rpm := None,

    rpmPreun in Rpm := None,

    rpmPostun in Rpm := None,

    projectID in Rpm <<= (organization, name, version) apply {
      (o, n, v) => ModuleID(o, n, v)
    }
  )
}

@mavilein
Copy link
Author

Forget to mention that this minimal example uses the 0.8.0-M1

@muuki88
Copy link
Contributor

muuki88 commented Sep 25, 2014

Thanks. This is an already know problem. You added the packageArchetype.java_server twice.
Play adds it by default and readding it leads to strange behavior. Removing will solve this issue.

@muuki88 muuki88 closed this as completed Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants