eriwen / gradle-js-plugin

Gradle plugin for working with JS
http://eriwen.github.io/gradle-js-plugin
Apache License 2.0
382 stars 113 forks source link

Gradle 6.0.1 Build Failed #177

Open i-hyun opened 4 years ago

i-hyun commented 4 years ago

today gradle 5.6.2 to 6.0.1 upgrade

but 6.0.1 build fail a plugin

* What went wrong: An exception occurred applying plugin request [id: 'com.eriwen.gradle.js', version: '2.14.1'] > Failed to apply plugin [id 'com.eriwen.gradle.js'] > Could not create an instance of type com.eriwen.gradle.js.JavaScriptExtension. > Could not create an instance of type com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSetContainer. > org.gradle.api.internal.AbstractNamedDomainObjectContainer: method <init>(Ljava/lang/Class;Lorg/gradle/internal/reflect/Instantiator;)V not found

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Thanks in advance.

rnentjes commented 4 years ago

It looks like this only needs a new release, the changes are already made.

For now I just added the jar locally (like so)

i-hyun commented 4 years ago

we a Gradle rollback 5.6.2 wait for a new release. Thank you :)

aramosvizcarra commented 4 years ago

Any estimated time for this release? Thanks in advance,

TeodoroFilippini commented 4 years ago

Release needed!

kdaham commented 4 years ago

Any ETA for a release that fixes this issue?

asaelitz commented 4 years ago

Waiting for new release...

Saggitar1us commented 4 years ago

Yes, release needed, please :)

i-hyun commented 4 years ago

@rnentjes 2.14.2-SNAPSHOT source is where ? make a changed by rnentjes ?

rnentjes commented 4 years ago

@i-hyun Just check out the repository and build it yourself

i-hyun commented 4 years ago

@rnentjes oh, checked X) thanks

lorenzopolidori commented 4 years ago

I solved this issue switching to webpack and calling it in a custom gradle task:

task webpackBuild(type: Exec) {
    workingDir 'base/path'
    commandLine 'npm', 'run', 'build'
}
hth commented 4 years ago

(jk) We may find solution to Covid-19 in a year but this project getting released in this timeframe is a far fetched thought.

ChrisAcrobat commented 4 years ago

Anyone that knows a workaround?

ChrisAcrobat commented 4 years ago

@eriwen Have you seen pull request #171?

gbalthasar commented 4 years ago

I got this js and the corresponding css plugin running with gradle 6.6.1

See my comment https://github.com/eriwen/gradle-css-plugin/issues/58#issuecomment-691494403 for instructions.

No modification is needed, just clone, build and use at your gradle script

xtianus commented 3 years ago

I forked and built the master branch with minor modifications. Some unit tests fail but minification works for me. I uploaded a compiled jar for convenience. See the top of the readme here: https://github.com/xtianus/gradle-js-plugin

xtianus commented 3 years ago

I went down the webpack rabbit hole only to find pain and sorrow. I suggest that, if you want to use a non-java minifier, you try Terser instead https://www.npmjs.com/package/terser which is what webpack uses. Besides, with webpack you may actually end up with a larger file than the original...

I solved this issue switching to webpack and calling it in a custom gradle task:

task webpackBuild(type: Exec) {
    workingDir 'base/path'
    commandLine 'npm', 'run', 'build'
}
CLOVIS-AI commented 3 years ago

Looks like this issue affects Gradle 7.+ as well (tested on 7.0.2 & 7.1.1)

jonfrench commented 3 years ago

For those looking for a similar solution which supports Gradle 6+, I migrated to:

https://github.com/gradle-webtools/gradle-minify-plugin

jamietanna commented 2 years ago

Note that building the JAR yourself isn't necessarily required - see https://github.com/jenkinsci/job-dsl-plugin/commit/6b7a8d813c3c3b9f5daf0fcee823c9fd128d8f42 for how I used the JitPack service