0

I have a GWT project and I build it with maven.

-T 1C clean install -pl admin-module -am -DskipTests -f pom.xml

And I have admin.gwt.xml file with this property:

<set-property name="user.agent" value="safari"/>

Can I pass this property to maven instead override it in admin.gwt.xml?

Something like this:

-T 1C clean install -pl admin-module -am -DskipTests -f pom.xml -user.agent=safari

I find only one answer but it does not work for me.

Pavel Petrashov
  • 1,073
  • 1
  • 15
  • 34
  • Regarding the amswer from Thomas Broyer, your command line looks like this:`-T 1C clean install -pl admin-module -am -DskipTests -f pom.xml -setProperty user.agent=safari`. But, as Thomas mentioned it will only work for sure with the TBroyer maven-gwt-plugin. – El Hoss Aug 14 '19 at 10:04
  • @ElHoss Can you link to that answer? I don't think just plain `-setProperty` will do anything to get it to a maven plugin (though I'd be very glad to learn something new today). At a glance, I'm not seeing anything about setting properties in any of the goals at https://tbroyer.github.io/gwt-maven-plugin/. – Colin Alworth Aug 14 '19 at 14:16
  • @Colin Alworth: I found the answer here ... https://stackoverflow.com/questions/21287480/is-it-possible-to-set-the-user-agent-property-from-the-command-line-using-the-gw – El Hoss Aug 14 '19 at 15:01
  • From that answer, that is what you would pass as an argument to the Compiler main(), not what you would pass to maven. In that answer, since `user.agent` was declared as a property, you would be able to pass `-Duser.agent=safari`, and restrict the build to only allow the one property value. – Colin Alworth Aug 14 '19 at 17:47

0 Answers0