-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
"dist" command should package all jars #535
"dist" command should package all jars #535
Conversation
…the packagedArtifacts task, instead of just the packageBin artifact.
Could you sign our CLA? |
Done. |
Looks good to me. Great to see that you implemented tests for it :) |
Good for me too. It's great to have tests on this. |
@deansher could you please send a new pull request which could be cleanly merged? Thanks |
Done: #538 From: Peter Hausel notifications@github.com @deansher https://github.com/deansher could you please send a new pull ‹ |
There is a problem with this new implementation : In play 2.0.4, when I wanted to publish the zip file containing all the jars, I just had to add the following setting to my build.scala :
So now the dist command is calling the playPackageEverything command which try to build all the artifacts (including my dist zip) -> ERROR :
@see my post on the google group : So how to publish the zip file ? I'm using play 2.1-RC2 java. |
Yeah there is a cycle here. But I don't see how to avoid it. For me the zip file itself is not an project artifact. Where do you want to publish it? |
I want to publish it on a nexus repo |
Why the zip file, and not the project jar itself along with the ivy or pom file describing the jar dependencies? |
I would like to use the standalone application on my production server. Don't want to install play on this server. |
Moreover, adding the code :
will bypass the setting :
This is very annoying because I encounter a problem during documentation generation
which prevent me to use the 'dist' command. |
Yes, with either Ivy, Maven or sbt on the server, you can fetch the project artifact along with its dependencies. The zip file is nothing but a file containing all the jars files. Now you can always use the zip file, but it's difficult to let sbt publish it to a Maven repository automatically for you. You can push it yourself using an HTTP request, SSH or whatever you want. Just write a |
Ok I will try this. Thank you. |
Well you can also override the task definition in your Build file, and back to the previous implementation. Something like: playPackageEverything <<= (state, thisProjectRef, crossTarget) flatMap { (s, r, crossTarget) =>
inAllDependencies(r, (packageBin in Compile).task, Project structure s).join
} |
It's working. |
Hello, we are struggling with the same problem as described here. We posted a question on stackoverflow. If you would be so kind as to help us with an answer for the community, and us, that would be great! http://stackoverflow.com/questions/17473088/play-2-1-sbt-publish-a-dist-cycle-in-tasks-error Thanks |
This pull request addresses lighthouse ticket #851:
Play's current "dist" implementation takes its input from the packageBin task, which is defined as "produces a main artifact, such as a binary jar," and which only returns a single File. This is sometimes insufficient. For example, it does not work if a Play project wants to publish a separate jar with convenience functionality for its clients, while also consuming that separate jar itself at runtime.
I believe a better approach is for the "dist" command to take its input from the packagedArtifacts task, which is defined as "packages all artifacts for publishing and maps the Artifact definition to the generated file" and returns a Map[Artifact,File].
I have discussed this with Guillaume.