-
Notifications
You must be signed in to change notification settings - Fork 158
Frequently_Asked_Questions
Q: Is this repository (https://github.com/maven-nar/nar-maven-plugin) the official home of the NAR plugin?
A: Yes. @duns, the original author, donated the plugin (with Sonatype's approval) to the community, since he no longer has time to maintain it.
A: Yes, it is now. It was rather dormant for the past few years, but now has at least two active maintainers (@ctrueden and @dscho), with a few others participating in the development as well.
A: To comply with the permitted usages of the Maven trademark. According to the Apache Project Management Committee:
The pmc is permitting persons who develop plugins for maven to use the mark maven in their plugin name provided the name and its usage meets certain criteria, amongst which is the "___-maven-plugin" naming scheme.The NAR plugin was previously named `maven-nar-plugin` because it was slated for adoption as an official Maven plugin, but that never happened. So the `artifactId` has been changed to `nar-maven-plugin`. (The `groupId` will need to change as well, but that is still pending.)
A: The maven-nar Google group.
A:
GitHub Issues. There
was a category for NAR in the Sonatype
JIRA, which was active until May 2013,
but it has apparently been deleted, so we unfortunately cannot migrate those
issues to GitHub. If you had filed an issue there which is still relevant to
the latest master
branch, please file a new GitHub issue for it. Thanks!
A: It was released to Sonatype's OSS repository on December 6th, 2013. Maven Central mirrors this repository, including the nar-maven-plugin.
A: Yes, stable releases are now available on Central!
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0</version>
</plugin>
The source for 3.0.0 is tagged on GitHub.
A: Several open source projects make use of the NAR plugin:
- DevZendo Cross-Platform FileSystem Access uses NAR. The POM is straightforward and may be a good first project to study for learning about NAR.
- SLIM-curve uses NAR with some extra configuration, and may be a good second project to study for seeing a few more parameters in action.
-
ImageJ has a native launcher
component which uses NAR. Search
the
pom.xml
for "nar" to find the relevant blocks. It is not a simple "hello world" example (e.g., it uses OS-specific profiles), but it is a working real-world use case which successfully builds on a Jenkins server farm including Windows, OS X and Linux nodes.
We would gladly welcome any other working examples of the NAR plugin in use!
A:
To use the latest code on the master branch and/or topic branches: clone the
code from GitHub, and build it using mvn install
. This installs the JAR into
your local Maven repository cache (typically at
~/.m2/repository/com/github/maven-nar/nar-maven-plugin/3.0.0-SNAPSHOT
).
Then add a reference to the plugin within your project's POM:
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0-SNAPSHOT</version>
</plugin>
It will resolve the plugin from your local cache.
Note that this approach is recommended only for testing, not for production
code, because anyone else building your code will then also need to build
nar-maven-plugin
beforehand as well.
A:
Call mvn -Prun-its -Dinvoker.test=<directory-name>
where <directory-name>
is something like it0003-jni
.
A:
First, run the integration test as specified above. Then, create a new file called invoker.properties
in target/it/<it-name>/
that contains this line:
invoker.mavenOpts = -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000
Now, run the integration test again. The JVM launched to run the test should suspend and wait for your next steps.
The next steps being to fire up Eclipse (or whatever IDE with debugging capabilities you want to use), to create a new Debug Configuration for Remote Debugging attaching to port 8000
and being associated with the nar-maven-plugin
project you imported previously with Import>Import Existing Maven Project
(you did, didn't you?), possibly to add breakpoints and finally to click the Debug
button of said debug configuration.