Passing additional parameters from release-plugin

9 views
Skip to first unread message

Naveen Swamy

unread,
May 17, 2018, 11:02:56 PM5/17/18
to mojohaus-dev
Hello there,

I have a question regarding how to pass extra arguments(such as cflags) from maven release plugin to native-maven-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
```
scalareleasedryrun:
(cd $(ROOTDIR)/scala-package; \
mvn -X release:prepare -DdryRun=true -DautoVersionSubmodules=true \
-P$(SCALA_PKG_PROFILE),$(SCALA_VERSION_PROFILE) \
-Darguments=-DskipTests -Dcxx="$(CXX)" \
-Dcflags="$(CFLAGS)" -Dldflags="$(LDFLAGS)" \
-Dlddeps="$(LIB_DEP) $(ROOTDIR)/lib/libmxnet.a")
```
The parent pom file is here

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?

Dan Tran

unread,
May 18, 2018, 1:51:45 AM5/18/18
to mojoha...@googlegroups.com
sounds like you need a profile activated at release time. see https://github.com/mojohaus/mojo-parent/blob/master/pom.xml for sample

this way you just  need to do


   mvn -B release:prepare release:perform -Pxxx-release


-Dan

--
You received this message because you are subscribed to the Google Groups "mojohaus-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojohaus-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mojoha...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojohaus-dev/5d07a717-25a8-4519-83a3-3a9434f202c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages