I don’t know if it helps but when i put the following in my pom.xml :
<plugins>
<plugin>
<groupId>org.apache.netbeans.utilities</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<verifyRuntime>warn</verifyRuntime>
<publicPackages>
<publicPackage>eu.mbda.ccm.testmodule</publicPackage>
</publicPackages>
<moduleDependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-core-windows</id>
<type>impl</type>
<explicitValue>org-netbeans-core-windows/2.81.1 >
1</explicitValue>
</dependency>
</moduleDependencies>
</configuration>
</plugin>
</plugins>
It looks better (even if I’m not sure) :
- The module compiles
- I’ve got the following error when compiling the app project :
Some included modules/bundles depend on these codenamebases but they are not
included. The application will fail starting up. The missing codenamebases are:
org-netbeans-core-windows ref: [eu.mbda.ccm.TestModule]
Any idea ?
De : Eymeric VIEUILLE <[email protected]>
Envoyé : jeudi 18 novembre 2021 14:12
À : Netbeans mailing list ([email protected])
<[email protected]>
Objet : [Newsletter] RE: [EXTERNAL] Re: Implementation dependency in a maven
module
Another source seems to mean that the moduleDependencies tag shall be in a
module.xml file :
https://dev.platform.netbeans.narkive.com/Dbfw7dYk/module-dependency-has-friend-dependency
But this file was not created at module creation…so maybe it was available only
on previous versions ?
De : Eymeric VIEUILLE
<[email protected]<mailto:[email protected]>>
Envoyé : jeudi 18 novembre 2021 10:43
À : Netbeans mailing list
([email protected]<mailto:[email protected]>)
<[email protected]<mailto:[email protected]>>
Objet : [Newsletter] RE: [EXTERNAL] Re: Implementation dependency in a maven
module
Hi,
Sorry for the response delay.
Probably it is the nbm-maven-plugin version. As a consequence, i tried the
following :
<plugins>
<plugin>
<groupId>org.apache.netbeans.utilities</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<verifyRuntime>warn</verifyRuntime>
<publicPackages>
<publicPackage>eu.mbda.ccm.testmodule</publicPackage>
</publicPackages>
<moduleDependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-core-windows</id>
<type>impl</type>
</dependency>
</moduleDependencies>
</configuration>
</plugin>
<plugins>
<dependencies>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-core-windows</artifactId>
<version>RELEASE121</version>
<scope>provided</scope>
</dependency>
</dependencies>
The project compiles but I still have a ClassNotFoundException for the class
NbSheet inside core-windows at application run. It is as if the implementation
dependency was not considered.
De : David Green <[email protected]<mailto:[email protected]>>
Envoyé : lundi 15 novembre 2021 16:42
À : Eymeric VIEUILLE <[email protected]<mailto:[email protected]>>; Netbeans
mailing list ([email protected]<mailto:[email protected]>)
<[email protected]<mailto:[email protected]>>
Objet : RE: [EXTERNAL] Re: Implementation dependency in a maven module
Is the document referring to the version
org.apache.netbeans.utilities:nbm-maven-plugin (or of Maven) rather than
maven-jar-plugin?
On Nov 15, 2021 at 9:12:28 AM, Eymeric VIEUILLE
<[email protected]<mailto:[email protected]>> wrote:
Hi,
Thx for the answer.
Like said before, I’m looking for a way to add an implementation dependency. I
found this :
http://bits.netbeans.org/mavenutilities/nbm-maven-plugin/manifest-mojo.html
The tag « moduleDependencies » seems to do what I am expecting but it is said
that this is only available from version 3.8
With older version of maven-jar-plugin, an error is present in pom file. With
later, the error disappears but when compiling i get :
Plugin org.apache.maven.plugins:maven-jar-plugin:3.14 or one of its
dependencies could not be resolved: Failure to find
org.apache.maven.plugins:maven-jar-plugin:jar:3.14 in
https://repo.maven.apache.org/maven2/ was cached in the local repository,
resolution will not be reattempted until the update interval of mirror1 has
elapsed or updates are forced -> [Help 1]
De : David Green <[email protected]<mailto:[email protected]>>
Envoyé : lundi 15 novembre 2021 15:02
À : Netbeans mailing list
([email protected]<mailto:[email protected]>)
<[email protected]<mailto:[email protected]>>; Eymeric VIEUILLE
<[email protected]<mailto:[email protected]>>
Objet : [EXTERNAL] Re: Implementation dependency in a maven module
Hi,
I am not a Maven expert but it looks like 3.2.1 is latest in github
apache/maven-jar-plugin (see pom.xml file). Are you perhaps wanting 3.1.4
instead of 3.14?
Dave
On Mon, Nov 15, 2021 at 7:39 AM Eymeric VIEUILLE
<[email protected]<mailto:[email protected]>> wrote:
Hi again !
Nobody has answers for it ?
Envoyé : lundi 8 novembre 2021 15:29
À : Netbeans mailing list
([email protected]<mailto:[email protected]>)
<[email protected]<mailto:[email protected]>>
Objet : Implementation dependency in a maven module
Hi !
I am doing the migration of a netbeans based application from Ant to Maven
(Netbeans 12.0 version)
In our project, we had implementation dependencies on netbeans modules
(core-windows for example). In the old way, no problem : on the dependency
core-windows, you could right click and go in « Edit » menu to select «
Implementation Version » and set the expected « Major Release Version » value.
Now with Maven, in my pom.xml, i added :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.14</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<OpenIDE-Module-Layer>framework/api/layer.xml</OpenIDE-Module-Layer>
</manifestEntries>
<moduleDependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-core-windows</id>
<type>impl</type>
</dependency>
</moduleDependencies>
</archive>
</configuration>
</plugin>
I get the following error when compiling :
Plugin org.apache.maven.plugins:maven-jar-plugin:3.14 or one of its
dependencies could not be resolved: Failure to find
org.apache.maven.plugins:maven-jar-plugin:jar:3.14 in
https://repo.maven.apache.org/maven2/ was cached in the local repository,
resolution will not be reattempted until the update interval of mirror1 has
elapsed or updates are forced -> [Help 1]
The 3.14 version of maven-jar-plugin is effectively not available on this
repository (only olders < 3.2). Am i pointing at the wrong maven repository ?
Moreover, I think i’m doing it the wrong way for adding the implementation
dependency properly in my project. Can you tell me how i can do it ?
--
Sent from a mobile device. Please excuse any typos.