guchenbo / simple-build-tool

Automatically exported from code.google.com/p/simple-build-tool
Other
0 stars 0 forks source link

Packaging war (and possibly other packages) brings sources jars into the web archive #154

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem (please be specific)?

Create a small project with at least one source inclusion. Create war package. 
See enclosed zip and listing at below for example.

What is the expected behavior? What do you see instead?

No sources in the war-file.

What versions of the following are you using?

Java: 1.6.0_24
Scala: 2.8.1
sbt: 0.7.4
Operating system: Mac OS X 10.6.6

Please provide any additional information below.

[thoraageeldby@iluvatar t]$ unzip -v target/scala_2.8.1/a_2.8.1-1.0.war 
Archive:  target/scala_2.8.1/a_2.8.1-1.0.war
 Length   Method    Size  Ratio   Date   Time   CRC-32    Name
--------  ------  ------- -----   ----   ----   ------    ----
      25  Defl:N       27  -8%  03-15-11 19:44  ee027fb2  META-INF/MANIFEST.MF
  172888  Defl:N   152744  12%  03-15-11 19:44  08ad178b  WEB-INF/lib/httpcore-4.0.1.jar
   46725  Defl:N    41643  11%  03-15-11 19:44  6eadf31a  WEB-INF/lib/commons-codec-1.3.jar
    8487  Defl:N     8132   4%  03-15-11 19:44  0520042f  WEB-INF/lib/dispatch-http_2.8.1-0.7.8-sources.jar
   98995  Defl:N    88457  11%  03-15-11 19:44  cd5d26fe  WEB-INF/lib/dispatch-http_2.8.1-0.7.8.jar
   12244  Defl:N    10421  15%  03-15-11 19:44  b1a80691  WEB-INF/lib/dispatch-futures_2.8.1-0.7.8.jar
   60686  Defl:N    55987   8%  03-15-11 19:44  b76bd046  WEB-INF/lib/commons-logging-1.1.1.jar
 6496110  Defl:N  5929356   9%  03-15-11 19:41  8507f1b3  WEB-INF/lib/scala-library.jar
  291037  Defl:N   259129  11%  03-15-11 19:44  810ef5ef  WEB-INF/lib/httpclient-4.0.1.jar
--------          -------  ---                            -------
 7187197          6545896   9%                            9 files
[thoraageeldby@iluvatar t]$ 

Original issue reported on code.google.com by thoraage...@gmail.com on 15 Mar 2011 at 6:54

Attachments:

GoogleCodeExporter commented 9 years ago
See http://code.google.com/p/simple-build-tool/issues/detail?id=44#c1 through 
comment 13 for a workaround.  In 0.9, this is not an issue.  It is undecided 
whether Jetty support in 0.9 will be builtin or a plugin, however.

Original comment by dmhar...@gmail.com on 16 Mar 2011 at 2:27

GoogleCodeExporter commented 9 years ago
I tried the configuration modifications you advised in the link:

  override def outputPattern = "[type]/[conf]/[artifact](-[revision])(-[classifier]).[ext]"
  override def configurationPath(c: Configuration): Path = managedDependencyPath / "jar" / c.toString

But it seemed to remove the scala-library as well:

[thoraageeldby@iluvatar tttt]$ unzip -v target/scala_2.8.1/a_2.8.1-1.0.war 
Archive:  target/scala_2.8.1/a_2.8.1-1.0.war
 Length   Method    Size  Ratio   Date   Time   CRC-32    Name
--------  ------  ------- -----   ----   ----   ------    ----
      25  Defl:N       27  -8%  03-16-11 10:06  ee027fb2  META-INF/MANIFEST.MF
   98995  Defl:N    88457  11%  03-16-11 10:06  cd5d26fe  WEB-INF/lib/dispatch-http_2.8.1-0.7.8.jar
  291037  Defl:N   259129  11%  03-16-11 10:06  810ef5ef  WEB-INF/lib/httpclient-4.0.1.jar
   12244  Defl:N    10421  15%  03-16-11 10:06  b1a80691  WEB-INF/lib/dispatch-futures_2.8.1-0.7.8.jar
   60686  Defl:N    55987   8%  03-16-11 10:06  b76bd046  WEB-INF/lib/commons-logging-1.1.1.jar
   46725  Defl:N    41643  11%  03-16-11 10:06  6eadf31a  WEB-INF/lib/commons-codec-1.3.jar
  172888  Defl:N   152744  12%  03-16-11 10:06  08ad178b  WEB-INF/lib/httpcore-4.0.1.jar
--------          -------  ---                            -------
  682600           608408  11%                            7 files
[thoraageeldby@iluvatar tttt]$ 

Original comment by thoraage...@gmail.com on 16 Mar 2011 at 9:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I tested this on the t.zip project (from my first message) and added the two 
lines of configuration modification to Project.scala.

Original comment by thoraage...@gmail.com on 17 Mar 2011 at 2:54

GoogleCodeExporter commented 9 years ago
Yes, that is what I did and it worked for me.

Original comment by dmhar...@gmail.com on 17 Mar 2011 at 2:55

GoogleCodeExporter commented 9 years ago
To be clear, a new zip helps verify I'm not doing something subtly different.

Original comment by dmhar...@gmail.com on 17 Mar 2011 at 3:23

GoogleCodeExporter commented 9 years ago
Here we go:

Original comment by thoraage...@gmail.com on 17 Mar 2011 at 3:59

Attachments:

GoogleCodeExporter commented 9 years ago
You need a source file in there and it should work ok.

Original comment by dmhar...@gmail.com on 17 Mar 2011 at 4:07

GoogleCodeExporter commented 9 years ago
Yup, that did the trick. Thanks. Looked like creating the simplest possible 
example backfired

Original comment by thoraage...@gmail.com on 17 Mar 2011 at 10:49