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 On Thu, May 17, 2018 at 8:02 PM, Naveen Swamy <mnnav...@gmail.com> wrote: > 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 > this is mvn command which we call through a makefile similar to > https://github.com/apache/incubator-mxnet/blob/48d60908a1 > fa42364a829ac90133d28dd0998219/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)" \ > -Dcflags="$(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.codeh > aus.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/scal > a-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/scal > a-package/init-native/osx-x86_64/target/native/include > [INFO] [DEBUG] (f) javahOS = darwin > [INFO] [DEBUG] (f) jdkIncludePath = /Library/Java/JavaVirtualMachi > nes/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.Nat > iveSources@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? > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to firstname.lastname@example.org. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/mojohaus-dev/5d07a717-25a8-4519-83a3-3a9434f202c5%40googlegroups.com > <https://groups.google.com/d/msgid/mojohaus-dev/5d07a717-25a8-4519-83a3-3a9434f202c5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to email@example.com. To view this discussion on the web visit https://groups.google.com/d/msgid/mojohaus-dev/CAPCjjnG%3Dwog8QKpGbMHdEbZdD%2BHKwVpWg7bDEudLt%2BqOABe-hw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.