question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to publish produced war file using sbt publish tasks

See original GitHub issue

We have a play 2.1.5 project on which play2-war-plugin 1.1 successfuly builds a war file.

Then when we try to publish the war artifact using standard sbt procedures the war task starts to fail.

Specifically, when we add the following settings:

addArtifact(artifact in war, war)

The war task fails printing the following error:

[error] java.lang.AssertionError: assertion failed: Internal task engine error: nothing running.  This usually indicates a cycle in tasks.
[error]   Calling tasks (internal task engine state):
[error] Task((task-definition-key: ScopedKey(Scope(Select(ProjectRef(file:/trunk/tmp/transferencias/,transferencias)),Global,Global,Global),play-package-everything))) -> Calling
[error] Use 'last' for the full log.

Remarkably that error is cited as the reason to exclude the mentioned settings from play2-war-plugin default settings in Play2WarSettings.play2warSettings.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
yannscommented, Mar 19, 2014

A workaround is to keep the war and the publish separated:

val packageWar = taskKey[File]("package-war")

packageWar := {
    val warFile = name.value + "-" + version.value + ".war"
    (baseDirectory in Compile).value / "target" / warFile
}

// create an Artifact for publishing the .war file
artifact in (Compile, packageWar) := {
  val previous: Artifact = (artifact in (Compile, packageWar)).value
  previous.copy(`type` = "war", extension = "war", classifier = Some("webapp"))
}

// add the .war file to what gets published
addArtifact(artifact in (Compile, packageWar), packageWar)

With that configuration, your must first generate the war and then call publish.

0reactions
PushkarniVKcommented, Aug 27, 2015

Hii,

I want to publish sbt zip file to nexus repository. Using versions (play -2.4.2 & sbt 0.13.6). I have tried above workaround for zip file publish. Its giving me authorization errors where everything is well set and working for another projects(for jar publish). I follow the steps below: 1 sbt compile -> Compile project 2 ./activator dist command -> creates .zip folder in target>universal dir of sbt project 3/ sbt publish -> used above workaround

Could you please post the workaound for sbt (target>universal> .zip file) publish ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SBT: Cannot publish to Apache Archiva - scala - Stack Overflow
Running Apache Archiva 1.4-M4(latest), I am able to upload via the web interface, but not via SBT. Using these settings in SBT: publishTo...
Read more >
Chapter 12. Distributing your projects - sbt in Action
Common methods of deploying JVM applications; Publishing common libraries/artifacts into a company repository; Generating a zip-based distribution; ...
Read more >
sbt Reference Manual — Publishing
This page describes how to publish your project. Publishing consists of uploading a descriptor, such as an Ivy file or Maven POM, and...
Read more >
Scala (SBT) Publishing to Github Packages - Steven Skelton
Maven publishing is supported by SBT in its sbt publish task, ... It is also similar to how a Java War file is...
Read more >
PublishBuildArtifacts@1 - Publish build artifacts v1 task
Use this task in a build pipeline to publish build artifacts to Azure Pipelines, TFS, or a file share. Syntax. YAML Copy. # ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found