Plugin manipulating POM files
"AlexFalappa" <[email protected]> Wed, 18 May 2016 20:17:13 +0000
| Newsgroups | gmane.comp.java.netbeans.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello everybody,
I'm coding a NetBeans plugin that should offer a code generator (Alt + Ins) inside maven pom.xml files.
I would like my code generator to behave a lot like the existing "Generate Dependency..." code generator and I studied its sources in the maven.grammar module (org.netbeans.modules.maven.codegen.DependencyGenerator).
The aforementioned generator manipulates the pom trough a maven pom model api contained in the maven.model module that seems to be unaccessible.
I managed to create such a generator in a prototype ant based netbeans module project by specifying an implementation dependency on the "Maven Editor Model" (codenamebase org.netbeans.modules.maven.model) but I would like to do the same in a maven based netbeans module project.
So far I added the following dependencies in the netbeans module project pom:
Code:
...
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-maven-model</artifactId>
<version>RELEASE691</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-maven-embedder</artifactId>
<version>RELEASE691</version>
</dependency>
...
The latter was required according to the nbm plugin.
I also specified an implementation dependency by configuring the nbm plugin as follows:
Code:
<configuration>
<moduleDependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-maven-model</id>
<type>impl</type>
</dependency>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-maven-embedder</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.maven.embedder/2 = 2.51.1</explicitValue>
</dependency>
</moduleDependencies>
</configuration>
The project compiles fine however when I run the plugin I get the following warning:
Warning - could not install some modules: NB SpringBoot - The module named org.netbeans.modules.maven.embedder/1 was needed and not found.
How should I configure the maven project to successfully work like the ant based prototype?
Thanks in advance.