gradle-js-plugin icon indicating copy to clipboard operation
gradle-js-plugin copied to clipboard

Gradle 6.0.1 Build Failed

Open i-hyun opened this issue 5 years ago • 20 comments

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.

i-hyun avatar Nov 21 '19 06:11 i-hyun

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

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

rnentjes avatar Nov 22 '19 09:11 rnentjes

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

i-hyun avatar Nov 25 '19 01:11 i-hyun

Any estimated time for this release? Thanks in advance,

aramosvizcarra avatar Nov 27 '19 21:11 aramosvizcarra

Release needed!

TeodoroFilippini avatar Dec 02 '19 13:12 TeodoroFilippini

Any ETA for a release that fixes this issue?

kdaham avatar Dec 03 '19 16:12 kdaham

Waiting for new release...

asaelitz avatar Dec 04 '19 15:12 asaelitz

Yes, release needed, please :)

Saggitar1us avatar Dec 09 '19 15:12 Saggitar1us

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

i-hyun avatar Dec 10 '19 05:12 i-hyun

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

rnentjes avatar Dec 10 '19 08:12 rnentjes

@rnentjes oh, checked X) thanks

i-hyun avatar Dec 10 '19 09:12 i-hyun

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'
}

lorenzopolidori avatar Dec 31 '19 11:12 lorenzopolidori

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

hth avatar Feb 26 '20 18:02 hth

Anyone that knows a workaround?

ChrisAcrobat avatar Apr 17 '20 23:04 ChrisAcrobat

@eriwen Have you seen pull request #171?

ChrisAcrobat avatar Apr 18 '20 08:04 ChrisAcrobat

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

gbalthasar avatar Sep 12 '20 14:09 gbalthasar

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 avatar Oct 07 '20 22:10 xtianus

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'
}

xtianus avatar Oct 08 '20 09:10 xtianus

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

CLOVIS-AI avatar Aug 17 '21 20:08 CLOVIS-AI

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

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

jonfrench avatar Sep 03 '21 12:09 jonfrench

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

jamietanna avatar Oct 27 '21 09:10 jamietanna