Search code examples
mavenmaven-nar-plugin

Error trying to use maven-nar-plugin


I'm trying to build a native "C" project using maven using maven-nar-plugin. I am getting the following errors:

[WARNING] The POM for org.apache.maven.plugins:maven-nar-plugin:jar:2.1-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.sec.mediascoop:mediascoop:1.0-SNAPSHOT (D:\source\metadata\mediascoop\pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin org.apache.maven.plugins:maven-nar-plugin:2.1-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-nar-plugin:jar:2.1-SNAPSHOT -> [Help 2]

Following is the relevant section from my pom file:

<project>
...
<packaging>nar</packaging>
...
<build>
    <defaultGoal>install</defaultGoal>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-nar-plugin</artifactId>
            <version>2.1-SNAPSHOT</version>
            <extensions>true</extensions>
            <configuration>
                <layout>NarLayout20</layout>
                <libraries>
                    <library>   
                        <type>shared</type>
                    </library>
                </libraries>
            </configuration>
        </plugin>
    </plugins>
</build>

More info:

  1. I'm using Maven version 3.0.5
  2. I cannot see the maven-nar-plugin in the Central Repository either
  3. I see it is available @ http://duns.github.io/maven-snapshots/. I don't know how to tell maven to look here. It's looking into (2) by default.

Solution

  • The nar plugin developers didn't add it to Maven Central. However, you can use the following module, which is a repackage of the nar plugin:

    http://mvnrepository.com/artifact/org.codeswarm/maven-nar-plugin

    It has been working fine for me.