as title says unable pass command line parameters java compiler using maven, using maven-compiler-plugin it, , accordingly this (specifically compilerargs option of pluging) using "latest way" speficy arguments passed compiler. enough talk, more code, maven configuration plug-in , not sure doing wrong:
<build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> <fork>true</fork> <compilerargs> <arg>-parameters</arg> </compilerargs> </configuration> </plugin> </plugins> </build> i following instructions usage of tool says <fork> have set true, , not know missing... little bit of please?
may or may not helpful mention that: need parameters argument specified here because want name of arguments in methods in runtime using reflection; use -x argument when calling maven see debug , shows me "fork" call , cannot se anywhere arguments passing (maybe need enable plug-in; think in case automatically enabled since not part of profile, not maven expert please correct me if wrong).
edit: have tried in several ways , without dash have tried "old way" it:
<compilerarguments> <parameters /> </compilerarguments> and:
<compilerargument>-parameters</compilerargument>
pfff guys forget it, , sorry bothering :(
my mistake: created code first previous modify pom file, , run using maven check working, after that modified pom include -parameters flag print name of my parameters in method see working. code had been compiled once without flag being set , the code never modified after therefor maven "said" 'well there no changes on file, not need re-compile it, i'll use 1 compiled before' (which thing, reduces compilation time) not in case because -parameters flag compiles code in way "fat class" (or @ least heavier since includes name of parameters) maven did not know that. t.t
solution execute mvn clean or delete compiled classes or deleate /target folder (in summary do ever necessary ensure files compiled again)
Comments
Post a Comment