Re: NBM Wrapper in maven for non-maven JAR

Randall Wood <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
I figured this out. I made public every package in the wrapped jar, not just the packages I was using (it’s possible I had some implicit dependencies on specific packages that I missed in the publicPackages listing in the wrapper).

> On 7 Jun 2016, at 08:13, Randall Wood <[email protected]> wrote:
> 
> I am working on a NetBeans Platform-based application that has dependencies on four externally provided JARs that are not in Maven central.
> 
> I tried creating a wrapper module by creating a local repository and including the publicPackages element in the wrapper module, which appears to work for the IDE, but does not compile with the error:
> "Project depends on packages not accessible at runtime in module org.jmri:openlcb:jar:0.1-SNAPSHOT”
> 
> What am I doing wrong?
> 
> This is the pom.xml file for the wrapper module (the wrapper module and its dependencies all have the same parent project):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>    <modelVersion>4.0.0</modelVersion>
>    <parent>
>        <groupId>org.jmri</groupId>
>        <artifactId>jmri</artifactId>
>        <version>0.1-SNAPSHOT</version>
>    </parent>
>    <artifactId>openlcb</artifactId>
>    <packaging>nbm</packaging>
>    <build>
>        <plugins>
>            <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>nbm-maven-plugin</artifactId>
>                <extensions>true</extensions>
>                <configuration>
>                    <useOSGiDependencies>false</useOSGiDependencies>
>                    <publicPackages>
>                        <publicPackage>org.openlcb</publicPackage>
>                        <publicPackage>org.openlcb.can</publicPackage>
>                        <publicPackage>org.openlcb.implementation</publicPackage>
>                    </publicPackages>
>                </configuration>
>            </plugin>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-jar-plugin</artifactId>
>                <configuration>
>                    <useDefaultManifestFile>true</useDefaultManifestFile>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
>    <dependencies>
>        <dependency>
>            <groupId>org.netbeans.api</groupId>
>            <artifactId>org-netbeans-api-annotations-common</artifactId>
>            <version>RELEASE81</version>
>        </dependency>
>        <dependency>
>            <groupId>org.openlcb</groupId>
>            <artifactId>openlcb</artifactId>
>            <version>0.6.5</version>
>        </dependency>
>    </dependencies>
>    <properties>
>        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>    </properties>
>    <name>OpenLCB Support</name>
>    <repositories>
>        <repository>
>            <id>lib</id>
>            <name>lib</name>
>            <releases>
>                <enabled>true</enabled>
>                <checksumPolicy>ignore</checksumPolicy>
>            </releases>
>            <snapshots>
>                <enabled>false</enabled>
>            </snapshots>
>            <url>file://${project.basedir}/lib</url>
>        </repository>
>    </repositories>
> </project>
> 
> Randall Wood
> Alexandria Software
> 202.683.8604
> [email protected]
> http://www.alexandriasoftware.com
> 

Randall Wood
Alexandria Software
202.683.8604
[email protected]
http://www.alexandriasoftware.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.