nb-springboot
nb-springboot copied to clipboard
Support for Gradle project
Hello,
I use Gradle. I don't mind having a POM in the same directory so the plugin can detect and display the SpringBoot options in the New... menus. The problem is when a POM is detected by other NB plugins, it turns to project into a Maven project instead of a Gradle project.
I forked the plugin sources and tried to rename the pom but no can do.
How could I fix this?
Thanks,
Jacques
@ledj0304 the problem of NetBeans recognizing a directory as the wrong project type is a known limitation, see Bug 256094 and Bug 269297.
Unfortunaltely I am not a Gradle user and I don't know the internals of NetBeans Gradle support. The NB Spring Boot was deliberately made with Maven project support in mind.
If someone with more Gradle and Gradle on NetBeans expertise will contribute I would be more than happy to include it.
Hello Alex,
Thanks for the quick answer.
I have tried the following simple workaround:
a) generate the project as a Maven project b) run .gradle init to initialize the directory as a Gradle project. c) rename pom.xml to maven-pom.xml d) in your nbm plugin, hardcode "maven-pom.xml' string inthe Initializr and recompile and install.
The rationale is the following: Leave the pom as a configuration source for your plugin, allowing NB to display the SpringBoot templates while using Gradle for the build.
a) as NB will display a Maven project as soon as it detects a pom.xml, we either have to rename the pom (to either a constant name or a configurable name or path) or move it to another directory (maybe .nb-gradle initiated by the NB gradle plugin). Doing so causes NB to apply the Gradle module logic instead of the Maven module (this works fine). b) When your module scans for the pom-xml configuration, if pom is not in root directory, use the alternate pom name or path.
Unfortunately, my hack did not work as it seems that the pom.xml is defaulted somewhere else in the call stack, probably in the maven module.
Maybe that will inspire you for a quick hack. In the meantime, I use the NB terminal window to manually drive the build.
Thanks for your kind attention,
Jacques
On Sun, Feb 19, 2017 at 9:42 AM, Alessandro Falappa < [email protected]> wrote:
@ledj0304 https://github.com/ledj0304 the problem of NetBeans recognizing a directory as the wrong project type is a known limitation, see Bug 256094 https://netbeans.org/bugzilla/show_bug.cgi?id=256094 and Bug 269297 https://netbeans.org/bugzilla/show_bug.cgi?id=269297.
Unfortunaltely I am not a Gradle user and I don't know the internals of NetBeans Gradle support. The NB Spring Boot was deliberately made with Maven project support in mind.
If someone with more Gradle and Gradle on NetBeans expertise will contribute I would be more than happy to include it.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AlexFalappa/nb-springboot/issues/74#issuecomment-280923376, or mute the thread https://github.com/notifications/unsubscribe-auth/AF1Q2TKuHaKpYAag8waMJ6nf6LLcNmRrks5reFTQgaJpZM4MEl8P .
@AlexFalappa @ledj0304 Hi, I just want to add some useful information that might help you not loose time:
- I had troubles in NetBeans having both a pom.xml and a build.gradle file, no matter what you do, Netbeans has hardcoded that pom.xml prevails and your project will always end being a Maven project
- this depends on the fact in NetBeans(NB for short) you do not have a concept of Project nature like in Eclipse
- if your project started as Maven, it is difficult to convince NB it is something else (I think I had to hack NB configuration files to revert to gradle)
Anyway your plugin is very nice and it would be great to have Gradle support.
The recently released NetBeans 11 added support for the Gradle build system.