You can define a property in your Pom file and then set the configuration with that property and then use the cli to override that property...
But the bigger question is *why* do you think you want to do this? Most likely you don't and instead animal-sniffer is what you want... Or perhaps there is some other pattern that you should be following... Please tell us what craziness you have in mind and maybe we can help you achieve your aims a bit closer to the maven way than it seems you are headed On Monday, 7 January 2013, Jason Voegele wrote: > The maven-compiler-plugin allows one to set the maven.compiler.target > property in the POM, the value of which is in turn passed as the -target > argument to the Java compiler. I would like to be able to set this > maven.compiler.target on the command-line instead, as follows: > > mvn clean compile -Dmaven.compiler.target=1.5 > > However, when I try this it seems to have no effect on the compiled class > files. Furthermore, when I set -Dmaven.compiler.target to some illegal > value the build still succeeds and the class files still have the same > minor and major version numbers (as shown by javap). All of this leads me > to believe that the -Dmaven.compiler.target property being passed on the > command-line is being ignored. > > Is there any way to set the value of the -target compiler parameter from > the mvn command-line? > > -- > Jason Voegele > Parents often talk about the younger generation as if they didn't have > much of anything to do with it. > >
