Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use actively maintained node plugin #19

Open
hosswald opened this issue Apr 20, 2021 · 4 comments
Open

Use actively maintained node plugin #19

hosswald opened this issue Apr 20, 2021 · 4 comments

Comments

@hosswald
Copy link

hosswald commented Apr 20, 2021

The node plugin you are using is causing problems for me (with Gradle 6):

Execution failed for task ':nodeSetup'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not find org.nodejs:node:15.9.0.
     Searched in the following locations:
       - https://nodejs.org/dist/v15.9.0/ivy.xml

The problem is described in the github repo for gradle plugin com.moowork.node. Someone writes there:

There's an actively maintained fork at https://github.com/node-gradle/gradle-node-plugin

(moowork was updated last in 2019, the fork is being actively developed).
I tried adding plugins { "com.github.node-gradle.node" version "3.0.1"} to my build.gradle, but that gives me

An exception occurred applying plugin request [id: 'com.github.michaelruocco.gradle-postman-runner', version: '0.1.3']
> Failed to apply plugin 'com.moowork.node'.
   > Cannot add extension with name 'node', as there is an extension already registered with that name.

e.g. com.github.node-gradle.node and com.moowork.node are conflicting.
Could you please switch to using the actively maintained branch?

@cah-abhijeet-singh
Copy link

@hosswald Did you find any workaround to this ?

@simomat
Copy link
Collaborator

simomat commented Apr 12, 2022

I'm looking into this, but can't promise to get a decent port to gradle-node-plugin yet.

@cah-abhijeet-singh
Copy link

Thanks for responding @simomat.

What kind of a challenge are we looking at ? Are the APIs of the two plugins completely different (in this case we are looking at substantial amount of re-work).

Asking to get a better idea whether this is something worthwhile to pursue for me and what kind of effort is required. I am completely new to gradle plugins and have to start from the very beginning.

@michaelruocco
Copy link
Owner

michaelruocco commented Apr 24, 2022

I did look at this before, and to be honest I struggled, it wasn't really a simple port from one plugin to the other. It is a reasonable amount of rework, and I ran into a couple of blockers, although it was a good year or so ago now, so I can't remember what the specifics were. I would have to try again to try and remind myself.

In some of my projects, I have found that not using this plugin at all and just using the id "com.github.node-gradle.node" plugin directly worked okay, so this could potentially be a reasonable alternative for you guys too?

e.g. https://github.com/michaelruocco/idv-context/blob/master/app/spring/build.gradle#L126-L139

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

No branches or pull requests

4 participants