You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by Naveen Swamy <mn...@gmail.com> on 2018/05/17 23:00:50 UTC

Fwd: [maven-release-plugin] Passing additional parameters

I posted this to the maven email list, if someone here already know the
answer, please let me know. I am trying to pass arguments(cflags, etc.,) to
maven-native during release:prepare

---------- Forwarded message ----------
From: Naveen Swamy <mn...@gmail.com>
Date: Thu, May 17, 2018 at 2:20 PM
Subject: [maven-release-plugin] Passing additional parameters
To: users@maven.apache.org, dev@maven.apache.org


Hello there,

I have a question regarding maven release plugin. We use codehaus
native-plugin to build jni, I want to pass the cflags during release phase.
However I see that I am unable to pass any of the arguments through release
plugin. Any experience or pointers would help
this is mvn command which we call through a makefile similar to
https://github.com/apache/incubator-mxnet/blob/
48d60908a1fa42364a829ac90133d28dd0998219/Makefile#L579
```
scalareleasedryrun:
(cd $(ROOTDIR)/scala-package; \
mvn -X release:prepare -DdryRun=true -DautoVersionSubmodules=true \
-P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) \
-Darguments=-DskipTests -Dcxx="$(CXX)" \
-Drelease.cflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")
```
The parent pom file is here
https://github.com/apache/incubator-mxnet/blob/master/scala-package/pom.xml
and the pom file to compile native code is here https://github.com/apache/
incubator-mxnet/blob/master/scala-package/init-native/osx-x86_64/pom.xml#L59

I see that cflags variable used in the native pom.xml is coming as null
```
[INFO] [INFO] --- native-maven-plugin:1.0-alpha-9:compile (default-compile)
@ libmxnet-init-scala-osx-x86_64 ---
[INFO] [DEBUG] Configuring mojo org.codehaus.mojo:native-
maven-plugin:1.0-alpha-9:compile from plugin realm ClassRealm[extension>org.
codehaus.mojo:native-maven-plugin:1.0-alpha-9, parent: sun.misc.Launcher$
AppClassLoader@42a57993]
[INFO] [DEBUG] Configuring mojo 'org.codehaus.mojo:native-
maven-plugin:1.0-alpha-9:compile' with basic configurator -->
[INFO] [DEBUG]   (f) compilerEndOptions = [-I../../../include, null]
[INFO] [DEBUG]   (f) compilerOutputDirectory =
/Users/wamy/nswamy/deepengine/workspace/incubator-mxnet/
scala-package/init-native/osx-x86_64/target/objs
[INFO] [DEBUG]   (f) compilerProvider = generic-classic
[INFO] [DEBUG]   (f) compilerStartOptions = [-std=c++0x]
[INFO] [DEBUG]   (f) dependencyIncludeDirectory =
/Users/wamy/nswamy/deepengine/workspace/incubator-mxnet/
scala-package/init-native/osx-x86_64/target/native/include
[INFO] [DEBUG]   (f) javahOS = darwin
[INFO] [DEBUG]   (f) jdkIncludePath = /Library/Java/
JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre/../include
[INFO] [DEBUG]   (f) numberOfConcurrentCompilation = 1
[INFO] [DEBUG]   (f) project = MavenProject: org.apache.mxnet:libmxnet-
init-scala-osx-x86_64:1.2.0-SNAPSHOT @ /Users/wamy/nswamy/deepengine/
workspace/incubator-mxnet/scala-package/init-native/osx-x86_64/pom.xml
[INFO] [DEBUG]   (s) directory = /Users/wamy/nswamy/deepengine/
workspace/incubator-mxnet/scala-package/init-native/src/main/native
[INFO] [DEBUG]   (s) fileNames = [org_apache_mxnet_init_native_c_api.cc]
[INFO] [DEBUG]   (f) sources = [org.codehaus.mojo.natives.
NativeSources@1e01b195]
[INFO] [DEBUG]   (f) workingDirectory = /Users/wamy/nswamy/deepengine/
workspace/incubator-mxnet/scala-package/init-native/osx-x86_64

```

I have already tried pass with -Darguments, create properties corresponding
to the flags, etc.,


Appreciate pointers and advise?

-Naveen