This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200443 - nbm POM.xml with incorrect exported APIs or public packages using a my.org.package.* being created by Maven nbm project support
Summary: nbm POM.xml with incorrect exported APIs or public packages using a my.org.pa...
Status: RESOLVED INVALID
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 17:18 UTC by _ wadechandler
Modified: 2011-07-27 18:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Working demo of <publicPackage>something.*</> (11.02 KB, application/octet-stream)
2011-07-27 17:47 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ wadechandler 2011-07-27 17:18:27 UTC
If I have a package with multiple sub packages in a Maven NBM project and I export the sub-packages and choose the parent package as well, then the Maven NBM project support will remove the public package tags for the sub-packages and replace them with the parent package followed by a .*. Other Maven NBM projects declaring a dependency upon those modules will then not see any classes from those .* packages. Seems the .* is not supported, and is incorrect. I have been manually removing the .* lines when this occurs and manually adding each individual sub-package to the POM.xml to correct the issue. This makes the tool support in NetBeans hard to use for Maven NBM projects.

For instance, imagine I have the packages:
my.domain.top
my.domain.top.sub1
my.domain.top.sub2
my.domain.top.sub3

If I go into project properties and change my public packages to all of those, then the tooling will covert from
<public-package>my.domain.top</public-package>
<public-package>my.domain.top.sub1</public-package>
<public-package>my.domain.top.sub2</public-package>
<public-package>my.domain.top.sub3</public-package>

to

<public-package>my.domain.top.*</public-package>

and then any modules depending on that one will be broke until I manually repair the POM. If needed I can create a simple example to use for testing.
Comment 1 _ wadechandler 2011-07-27 17:21:06 UTC
The worst part of this issue s that if one fixes it manually, and then for any reason must open project properties and press OK, then they will have a corrupted POM which they must then fix again manually. Thus it is a huge time drain on less mature projects.
Comment 2 Jesse Glick 2011-07-27 17:46:01 UTC
(In reply to comment #0)
> If I have a package with multiple sub packages in a Maven NBM project and I
> export the sub-packages and choose the parent package as well, then the Maven
> NBM project support will remove the public package tags for the sub-packages
> and replace them with the parent package followed by a .*.

Yes, this is a feature.

> Other Maven NBM
> projects declaring a dependency upon those modules will then not see any
> classes from those .* packages.

Works for me.

> Seems the .* is not supported, and is incorrect.

It is supported. See: http://mojo.codehaus.org/nbm-maven-plugin/manifest-mojo.html#publicPackages

When I try it, the resulting manifest has

OpenIDE-Module-Public-Packages: my.domain.top.**

as expected.
Comment 3 Jesse Glick 2011-07-27 17:47:15 UTC
Created attachment 109645 [details]
Working demo of <publicPackage>something.*</>
Comment 4 _ wadechandler 2011-07-27 18:11:19 UTC
I will reexamine the issue on our end then Jesse. Thank you.