Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

Gradle 6.0.1 Build Failed #177

Open
i-hyun opened this issue Nov 21, 2019 · 20 comments
Open

Gradle 6.0.1 Build Failed #177

i-hyun opened this issue Nov 21, 2019 · 20 comments

Comments

@i-hyun
Copy link

i-hyun commented Nov 21, 2019

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
Copy link

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
Copy link
Author

i-hyun commented Nov 25, 2019

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

@aramosvizcarra
Copy link

Any estimated time for this release?
Thanks in advance,

@TeodoroFilippini
Copy link

Release needed!

@kdaham
Copy link

kdaham commented Dec 3, 2019

Any ETA for a release that fixes this issue?

@asaelitz
Copy link

asaelitz commented Dec 4, 2019

Waiting for new release...

@Saggitar1us
Copy link

Yes, release needed, please :)

@i-hyun
Copy link
Author

i-hyun commented Dec 10, 2019

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

@rnentjes
Copy link

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

@i-hyun
Copy link
Author

i-hyun commented Dec 10, 2019

@rnentjes oh, checked X)
thanks

@lorenzopolidori
Copy link

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
Copy link

hth commented Feb 26, 2020

(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
Copy link

Anyone that knows a workaround?

@ChrisAcrobat
Copy link

@eriwen Have you seen pull request #171?

@gbalthasar
Copy link

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

See my comment eriwen/gradle-css-plugin#58 (comment) for instructions.

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

@xtianus
Copy link

xtianus commented Oct 7, 2020

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
Copy link

xtianus commented Oct 8, 2020

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
Copy link

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

@jonfrench
Copy link

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

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

jamietanna added a commit to jenkinsci/job-dsl-plugin that referenced this issue Oct 27, 2021
Releases were broken with the previous version of the JPI plugin [0],
therefore we needed to try upgrading to the latest version.

As the latest version requires Gradle 6, we have a few changes to make:

- `jenkinsVersion` needs to be referenced through `project.properties`
- the `war` plugin needs to be explicitly added
- the CSS/JS plugins we're using are not yet released[1][2], so we can
  follow the tricks in Spotless[3] to use the version from the (pinned)
  latest commit on GitHub

Next, as we're upgrading the JPI plugin, we need to:

- migrate to using `implementation` / `testImplementation`
- add Feature Variants for each of the `optionalJenkinsPlugins` -
  although I'm not sure if they're needed right now, we'll produce them
  for now and review later

See also https://groups.google.com/g/jenkinsci-dev/c/CDVvgj9dDMs

[0]: jenkinsci/gradle-jpi-plugin#192
[1]: eriwen/gradle-css-plugin#58
[2]: eriwen/gradle-js-plugin#177
[3]: https://github.com/diffplug/spotless/blob/a7f25eb51c6d4006591ea911157e62d0213e320b/CONTRIBUTING.md
@jamietanna
Copy link

Note that building the JAR yourself isn't necessarily required - see jenkinsci/job-dsl-plugin@6b7a8d8 for how I used the JitPack service

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests