38

Adding the following settings to the build.sbt file of a Play 2.2.x app does not disable Scaladoc generation. How can it be disabled?

play.Project(appName, appVersion, appDependencies)
    .settings(scalaVersion := "2.10.3")
    .settings(jsSettings : _*)
    .settings(
        publishArtifact in (Compile, packageDoc) := false,
        publishArtifact in packageDoc := false
    )
Community
  • 1
  • 1
Max L.
  • 9,774
  • 15
  • 56
  • 86

1 Answers1

63

Add the following settings to the Play project:

sources in (Compile,doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false

With the change it should be as follows:

play.Project(appName, appVersion, appDependencies)
    .settings(scalaVersion := "2.10.3")
    .settings(jsSettings : _*)
    .settings(
        publishArtifact in (Compile, packageDoc) := false,
        publishArtifact in packageDoc := false,
        sources in (Compile,doc) := Seq.empty
    )

Thanks @peter-hilton for the comment!

Community
  • 1
  • 1
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
  • 4
    This seems to prevent creating the docs JAR for me: `settings(publishArtifact in (Compile, packageDoc) := false)`, and the same with `packageSrc` for the sources. – Peter Hilton Feb 10 '14 at 14:04
  • 4
    Works for me with Play 2.3.2: https://github.com/guardian/gu-who/commit/340d42acdef8f0b1a085026d9fb5276976ac0607 – Roberto Tyley Aug 20 '14 at 21:55
  • 1
    Great answer. The official document goes a long way in how to include the stuff but not how to disable it. The answer was not clear to me wheter to include play.Project... but in my case just having the two lines in the first code block of the post was all needed. Now I can build and stage my app under 30 seconds as opposed to 5 min! Thank you! – Manabu Tokunaga Jun 03 '20 at 16:19