greenlaw110 / greenscript

A tool help web developers manage javascript/css rendering, including minimize and dependence management
42 stars 24 forks source link

Module build mavenization #29

Closed gslowikowski closed 12 years ago

greenlaw110 commented 12 years ago

Hi Grzegorz, I tried to merge your changes, so far it looks okay, until I want to change the version of YUI compressor from 2.4.6 to 2.4.7, it reports "The POM for com.yahoo.platform.yui:yuicompressor:jar:2.4.7 is missing, no dependency information available". Do you know which maven repository I can find the 2.4.7 version?

greenlaw110 commented 12 years ago

Hi, I can successfully build greenscript-core (suppose I keep YUIcompressor to 2.4.6), but when I switch to greenscript-play folder and run package I got the following error:

[ERROR] Failed to execute goal on project greenscript-play: Could not resolve dependencies for project com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.7-SNAPSHOT: Failure to find com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.7-SNAPSHOT in http://maven-play-plugin.googlecode.com/svn/mavenrepo/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of com.google.code.maven-play-plugin-snapshots has elapsed or updates are forced -> [Help 1]

Please help out.

gslowikowski commented 12 years ago

Hi Green

Version 2.4.7 is not present in Maven public repo: http://repo2.maven.org/maven2/com/yahoo/platform/yui/yuicompressor/

I must investigate.

Grzegorz

On 2012-02-15 12:53, Green Luo wrote:

Hi Grzegorz, I tried to merge your changes, so far it looks okay, until I want to change the version of YUI compressor from 2.4.6 to 2.4.7, it reports "The POM for com.yahoo.platform.yui:yuicompressor:jar:2.4.7 is missing, no dependency information available". Do you know which maven repository I can find the 2.4.7 version?


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3979017

gslowikowski commented 12 years ago

Hi

Did you install "greenscript-core" ("mvn install") in local repo or just packaged ("mvn package")? You have to install.

I found that one recently developed JS Maven plugin: http://svn.codehaus.org/mojo/trunk/mojo/webminifier-maven-plugin/ uses 2.4.6 version It would be best if YUICompressor authors would publish 2.4.7

On 2012-02-15 13:03, Green Luo wrote:

Hi, I can successfully build greenscript-core (suppose I keep YUIcompressor to 2.4.6), but when I switch to greenscript-play folder and run package I got the following error:

[ERROR] Failed to execute goal on project greenscript-play: Could not resolve dependencies for project com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.7-SNAPSHOT: Failure to find com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.7-SNAPSHOT in http://maven-play-plugin.googlecode.com/svn/mavenrepo/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of com.google.code.maven-play-plugin-snapshots has elapsed or updates are forced -> [Help 1]

Please help out.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3979129

greenlaw110 commented 12 years ago

Thanks, now mvn package success in greenscript/play project. However, I wonder how to build the package using mvn command?

On Thu, Feb 16, 2012 at 12:28 AM, gslowikowski < reply@reply.github.com

wrote:

Hi

Did you install "greenscript-core" ("mvn install") in local repo or just packaged ("mvn package")? You have to install.

I found that one recently developed JS Maven plugin: http://svn.codehaus.org/mojo/trunk/mojo/webminifier-maven-plugin/ uses 2.4.6 version It would be best if YUICompressor authors would publish 2.4.7

On 2012-02-15 13:03, Green Luo wrote:

Hi, I can successfully build greenscript-core (suppose I keep YUIcompressor to 2.4.6), but when I switch to greenscript-play folder and run package I got the following error:

[ERROR] Failed to execute goal on project greenscript-play: Could not resolve dependencies for project com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.7-SNAPSHOT: Failure to find com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.7-SNAPSHOT in http://maven-play-plugin.googlecode.com/svn/mavenrepo/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of com.google.code.maven-play-plugin-snapshots has elapsed or updates are forced -> [Help 1]

Please help out.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3979129


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3980145

gslowikowski commented 12 years ago

mvn package -Pdist Distribution assembly is in the "dist" profile. I placed it in a profile because you don't need to create distribution archive every time you build the project.

BTW Change artifact versions in both modules from "1.2.7-SNAPSHOT" to "1.2.7" before preparing distribution.

gslowikowski commented 12 years ago

Ad. BTW I've just seen, you've released two new versions recently (1.2.7 and 1.2.8) and haven't forget about it.

greenlaw110 commented 12 years ago

Hi I can run that command successfully, but I still can't find my dist folder neither can I find play-greenscript-1.2.7.zip package file.

On Thu, Feb 16, 2012 at 5:37 AM, gslowikowski < reply@reply.github.com

wrote:

mvn package -Pdist Distribution assembly is in the "dist" profile. I placed it in a profile because you don't need to create distribution archive every time you build the project.

BTW Change artifact versions in both modules from "1.2.7-SNAPSHOT" to "1.2.7" before preparing distribution.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3986121

greenlaw110 commented 12 years ago

Yes, I want to release it with your change but I got to understand how it works before

On Thu, Feb 16, 2012 at 6:28 AM, gslowikowski < reply@reply.github.com

wrote:

Ad. BTW I've just seen, you've released two new versions recently (1.2.7 and 1.2.8) and haven't forget about it.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3987138

greenlaw110 commented 12 years ago

Hi I found it in the target folder. looks good. I will wait you to solve YUICompressor 2.4.7 version problem and release new version with maven!

On Thu, Feb 16, 2012 at 6:30 AM, green greenlaw110@gmail.com wrote:

Yes, I want to release it with your change but I got to understand how it works before

On Thu, Feb 16, 2012 at 6:28 AM, gslowikowski < reply@reply.github.com

wrote:

Ad. BTW I've just seen, you've released two new versions recently (1.2.7 and 1.2.8) and haven't forget about it.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-3987138

gslowikowski commented 12 years ago

I found two problems: one with YUICompressor and one with LessCss 1.1.5.

  1. lesscss-engine - look at my comment here: https://github.com/asual/lesscss-engine/pull/24
  2. yuicompressor problem is worse. Two last versions (2.4.2 and 2.4.6) in Maven central repository http://repo2.maven.org/maven2/com/yahoo/platform/yui/yuicompressor/ are "buggy" and should not be used at all !!! yuicompressor has modified (!) version 1.6R7 of Rhino and (original) 1.0 version of JArgs built-in. Artifacts (jar files) in Maven central repository are different. The person who is responsible for publishing them changed them in a way which is not acceptable. They contain all YUICompressor and JArgs classes from original distribution jar file, but only the modified Rhino classes plus Maven dependency to original Rhino 1.6R7. The result is that two sets of 6 Rhino classes are present in the classpath - the original ones and the yuicompressor modified ones. If yuicompressor jar will be present in the classpath before rhino jar, the modified ones will be used. In opposite situation - the original will be used. Neither Maven nor Play! allow you for classpath ordering, so the result will not be predictable. You shold use the original jar file from yuicompressor distribution. I've deployed it to my repository yesterday (with changed groupId). I always add my prefix to groupId to avoid potential conflicts with artifact authors if they would like to deploy their artifact themselves some day. Add this dependency to your pom.xml:

    <dependency>
       <groupId>com.google.code.maven-play-plugin.com.yahoo.platform.yui</groupId>
       <artifactId>yuicompressor</artifactId>
       <version>2.4.7</version>
    </dependency>
gslowikowski commented 12 years ago

... and my repository definition. I will refresh my clone of greenscript project soon.

gslowikowski commented 12 years ago

OK, look at my refreshed version. I downgraded lesscss-engine to 1.1.4, I don't know yet, how will you solve the problem with 1.1.5 version I described earlier.

greenlaw110 commented 12 years ago

What I did is nothing to do with maven repository. I simple put the jar file I need to the lib folder of the project, for lessengine, it's lesscss-engine-1.1.5.jar size 31,350 bytes.

On Fri, Feb 17, 2012 at 9:13 PM, gslowikowski < reply@reply.github.com

wrote:

OK, look at my refreshed version. I downgraded lesscss-engine to 1.1.4, I don't know yet, how will you solve the problem with 1.1.5 version I described earlier.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-4017911

gslowikowski commented 12 years ago

Where did you get it from? I see it's available only in their Maven repo http://www.asual.com/maven/content/groups/public/com/asual/lesscss/lesscss-engine/1.1.5/

greenlaw110 commented 12 years ago

I download package from https://github.com/asual/lesscss-engine and run mvn package to build it, then I got that jar file from target folder

On Fri, Feb 17, 2012 at 9:48 PM, gslowikowski < reply@reply.github.com

wrote:

Where did you get it from? I see it's available only in their Maven repo http://www.asual.com/maven/content/groups/public/com/asual/lesscss/lesscss-engine/1.1.5/


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-4018332

gslowikowski commented 12 years ago

Aha, I avoid building somebody's projects myself, so I thought you found it somewhere. Their problem with Maven assembly manifests itself after deploying artifact. When you build it locally ("mvn package") everything is OK. Mavenized build must pull its dependencies from remote repositories. We can wait for a fixed version or deploy our own 1.1.5. I would prefer the first solution. Will wait for a moment, how will they respond.

gslowikowski commented 12 years ago

Fixed lesscss-engine (problem #1 above) will be available soon(?)

https://github.com/asual/lesscss-engine/pull/24

gslowikowski commented 12 years ago

Version 1.1.5 redeployed to lesscss repository. Remove it from your local Maven repo if you have downloaded it before.

Your project is ready for releasing with Maven.

greenlaw110 commented 12 years ago

Hi gslowikowski, thanks for your effort. BTW, I found there is a pom.xml inside java folder, which is the parent folder of core and play. Can you let me know how to use that pom.xml? Another question is is there a place for me to change the version number in all pom.xml files? say a property file?

greenlaw110 commented 12 years ago

Hi gslowikowski, I have the following problem after merged your changes:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project greenscript-core: Compilation failure: Compilation failure: [ERROR] C:\w_lgl\greenscript-1.2\java\core\src\main\java\com\greenscriptool\Minimizer.java:[35,24] package org.jcoffeescript does not exist [ERROR] [ERROR] C:\w_lgl\greenscript-1.2\java\core\src\main\java\com\greenscriptool\Minimizer.java:[36,24] package org.jcoffeescript does not exist

Could you please catch up to my latest version and help to fix this in maven building system?

gslowikowski commented 12 years ago

Which dependencies you need?

  1. jcoffeescript - which version (1.1 ?), what about another rhino build-in in this artifact? do we need to prepare our wersion without it?
  2. clojure compiler - com.google.javascript closure-compiler r1741

    ? what about it's dependencies (there are many artifacts)? which ones you need?

greenlaw110 commented 12 years ago

I need jcoffeescript-1.1.jar and google-closure.jar, there is no version info for closure, but I just download it from http://closure-compiler.googlecode.com/files/compiler-latest.zip.

Here is all jars used in greenscript-1.2.8:

41123 2012-02-20 08:50 commons-cli-1.2.jar 60686 2012-02-20 08:50 commons-logging-1.1.1.jar 44598 2012-02-20 08:50 commons-logging-api-1.1.jar 5352128 2012-02-20 08:50 google-closure.jar 91707 2012-02-20 08:50 greenscript-core-1.2.8.jar 1083394 2012-02-20 08:50 jcoffeescript-1.1.jar 237047 2012-02-20 08:50 junit-4.8.1.jar 31350 2012-02-20 08:50 lesscss-engine-1.1.5.jar 18599 2012-02-20 08:50 play-greenscript.jar 852957 2012-02-20 08:50 yuicompressor-2.4.7.jar

On Tue, Feb 21, 2012 at 12:56 AM, gslowikowski < reply@reply.github.com

wrote:

Which dependencies you need?

  1. jcoffeescript - which version (1.1 ?), what about another rhino build-in in this artifact? do we need to prepare our wersion without it?
  2. clojure compiler - com.google.javascript closure-compiler r1741

    ? what about it's dependencies (there are many artifacts)? which ones you need?


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-4053931

gslowikowski commented 12 years ago
  1. closure-compiler

Currently "compiler-latest.zip." equals "compiler-20120123.zip" (Built at r1741). There is official info about using with Maven http://code.google.com/p/closure-compiler/wiki/Maven.

What I found is that the jar from the distribution (you are using currently) is a jar-with-dependencies, it contains: closure-compiler:r1741 + args4j:2.012 + guava:10.0.1 + jsr305:1.3.9 + protobuf-java:2.4.1. In Maven repository the closure-compiler:r1741 artifact is "pure" closure-container, it does not contain its dependencies inside. In mavenized version you will have 5 jars which used together are equivalent to the one from distribution file.

closure-compiler has Rhino 1.7R4pre bundled, but it's "shaded". "Shading" is a term used in Maven world for bundling classes from another artifact, but with changed package name to avoid conflicts. closure-compiler changes "org.mozilla.javascript" to "com.google.javascript.rhino.head", BUT they didn't shade "org.mozilla.classfile" package, so you have two versions of all classes in it - here and in "yuicompressor" jar. I don't like it. If this was done in your other dependencies, we would have no problems with multiple Rhino versions in the classpath.

I've modified my repository clone. Because this pull request is closed, commits are not visible here.

  1. jcoffeescript

"jcoffeescript-1.1.jar" contains Rhino 1.7R2, doesn't it make you problems? This project is not active since 10 months.

greenlaw110 commented 12 years ago

Can you create an new pull requests to submit your changes?

about jcoffeescript, I am not sure if it's possible to use 1.7R4 to work with it. I am also getting headache on Rhino dependency hell, but we got to live with it before better solution comes out.

On Tue, Feb 21, 2012 at 9:00 PM, gslowikowski < reply@reply.github.com

wrote:

  1. closure-compiler

Currently "compiler-latest.zip." equals "compiler-20120123.zip" (Built at r1741). There is official info about using with Maven http://code.google.com/p/closure-compiler/wiki/Maven.

What I found is that the jar from the distribution (you are using currently) is a jar-with-dependencies, it contains: closure-compiler:r1741 + args4j:2.012 + guava:10.0.1 + jsr305:1.3.9 + protobuf-java:2.4.1. In Maven repository the closure-compiler:r1741 artifact is "pure" closure-container, it does not contain its dependencies inside. In mavenized version you will have 5 jars which used together are equivalent to the one from distribution file.

closure-compiler has Rhino 1.7R4pre bundled, but it's "shaded". "Shading" is a term used in Maven world for bundling classes from another artifact, but with changed package name to avoid conflicts. closure-compiler changes "org.mozilla.javascript" to "com.google.javascript.rhino.head", BUT they didn't shade "org.mozilla.classfile" package, so you have two versions of all classes in it - here and in "yuicompressor" jar. I don't like it. If this was done in your other dependencies, we would have no problems with multiple Rhino versions in the classpath.

I've modified my repository clone. Because this pull request is closed, commits are not visible here.

  1. jcoffeescript

"jcoffeescript-1.1.jar" contains Rhino 1.7R2, doesn't it make you problems? This project is not active since 10 months.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-4071989

greenlaw110 commented 12 years ago

Hi gslowikowski, need your help on this issue ASAP. I couldn't built the project and this block working on all other issues.

gslowikowski commented 12 years ago

New pull request created : https://github.com/greenlaw110/greenscript/pull/40