1

I want to accomplish what I think these directions describe.

I want to use an external, maven-based project from a rcp platform application.

I've used the new Project wizard to build a new maven-based application that include a maven-based module. I've added my external dependencies to the maven-based module.

I've also added the publicPackages section to my module's pom.

When I right-click on the module and go to ProjectProperties->PublicPackages I can see the correct packages listed with check marks.

My maven module builds just fine.

However, when I try to add the maven-module as a dependency of another module the packages listed in PublicPackages are not found.

If I peek inside the nbm I can see the jars I wanted exposed are under netbeans\modules\ext

Is there some way to build a maven-module that wraps another maven project?

The nbm-maven-plugin docs include an example which sounds alot like what I want to do:

Public packages declaration

By default all your module's packages (and classes) and private to the given module. If you want to expose any API to other modules, you will need to declare those public packages in your pom.xml. This includes not only your own classes but also any other 3rd party library classes that are packaged with your module and are to be exposed for reuse by other modules.

For example:

       <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>nbm-maven-plugin</artifactId>
           <version>3.8.1</version>
           <extensions>true</extensions>
           <configuration>
              <publicPackages>
                  <publicPackage>org.foo.api</publicPackage>
                  <publicPackage>org.apache.commons.*</publicPackage>
              </publicPackages>
           </configuration>
       </plugin>

there is a package org.foo.api made public (but not org.foo.api.impl package) and any package starting with org.apache.commons, so both org.apache.commons.io and org.apache.commons.exec packages are exposed to the outside

I am clearly not interpreting those doc correctly because this behavior is not what I'm seeing.

Ryan
  • 2,061
  • 17
  • 28
  • Did you solve this? If not, you never provided your POM in order to look at it. I'm having the same issue. – javydreamercsw May 12 '16 at 18:08
  • I have not resolved it but I also haven't retried it. Decided that I'm just going to pick a day and on that day rebuild all the modules and module suites as maven modules. Its been on the agenda for over a year and it hasn't happened but maybe soon... – Ryan May 13 '16 at 16:33

0 Answers0