Hi,

Thanks for your suggestions.

I tried the nar-maven-plugin as described on the usage page (
http://maven-nar.github.io/usage.html). I have the following pom:

<?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>

  <groupId>cz....</groupId>
  <artifactId>...</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>nar</packaging>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.maven-nar</groupId>
        <artifactId>nar-maven-plugin</artifactId>
        <version>3.2.3</version>
        <extensions>true</extensions>
        <configuration>
          <libraries>
            <library>
              <type>jni</type>
              <narSystemPackage>cz....</narSystemPackage>
            </library>
          </libraries>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


And the following maven version:

*Apache Maven 2.2.1 (rdebian-4)*

And when I run

*mvn clean package*

I get the following error


*Internal error in the plugin manager executing goal
'com.github.maven-nar:nar-maven-plugin:3.2.3:nar-validate': Unable to load
the mojo 'com.github.maven-nar:nar-maven-plugin:3.2.3:nar-validate' in the
plugin 'com.github.maven-nar:nar-maven-plugin'. A required class is
missing: org/sonatype/aether/resolution /ArtifactResolutionException
org.sonatype.aether.resolution.ArtifactResolutionException*
What's wrong?

Thanks,
Dusan



2015-08-01 21:05 GMT+02:00 Benson Margulies <[email protected]>:

> Look for the modern nar plugin on github.
>
> On Fri, Jul 31, 2015 at 12:59 PM, Karl Heinz Marbaise <[email protected]>
> wrote:
> > Hi,
> >
> > On 7/31/15 6:51 PM, Dušan Rychnovský wrote:
> >>
> >> Hi,
> >>
> >> I'm creating a JNI wrapper on top of a C++ library. I'd like to have a
> >> "one-click" Maven build for the whole application. When building it
> >> manually, I need to do the following:
> >>
> >> javac ... (compile the Java source files)
> >> javah ... (generate JNI header files from Java class files)
> >> g++   ... (compile the JNI source files + link them with the static
> >> library)
> >>
> >> I'm looking for a way to have these commands executed by Maven.
> >>
> >> I looked at the native-maven-plugin (
> >> http://maven.apache.org/archives/maven-1.x/plugins/native/index.html)
> and
> >> I'm afraid it will not work for me.
> >
> >
> > Nor should it cause Maven 1 is simply dead..
> >
> >
> >>
> >> * The documentation is extremely insufficient (there is literally no
> >> official documentation on the plugin site and nor is there any
> information
> >> elsewhere on the Internet).
> >
> >
> > which is not really astonishing...
> >
> >
> >>
> >> * I cannot even look at the source-code as it isn't there in the SVN
> >> repository linked from the plugin site.
> >>
> >> * I tried to make it work based on the two SO posts I discovered but I
> >> couldn't.
> >>
> >> I'm thinking about the following project layout:
> >>
> >> /src
> >> /src/main
> >> /src/main/java    ... the Java interfaces with native methods
> >> /src/main/native ... the C++ implementation of the generated header
> files
> >>
> >> The static library itself is a product of a different project and will
> be
> >> installed on my system in a standard location (i.e. outside of this
> >> project).
> >>
> >> What I need is essentially to call the javah and g++ commands after the
> >> Java .class files have been generated. The g++ command is non-trivial,
> >> there are quite a few compiler and linker options that need to be
> applied.
> >> The generated library file should not be a part of the generated JAR
> file,
> >> it should be a separate artifact.
> >>
> >> I was thinking maybe I'll need to use the exec-maven-plugin (
> >> http://www.mojohaus.org/exec-maven-plugin/index.html) and run the
> commands
> >> manually? Or is there a better way to do this?
> >>
> >> Also, once the library is generated, I'd like to have Maven run some
> test
> >> cases using the generated JNI wrapper to make sure it works correctly.
> >>
> >> Thanks very much for your help.
> >>
> >> Kind regards,
> >> Dusan
> >>
> >
> > I woudl suggest to take a look into the nar-maven-plugin:
> >
> > http://maven-nar.github.io/
> >
> > which might be better fit your needs..
> >
> > Kind Regards
> > Karl Heinz Marbaise
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to