Can I force Maven 2 to require a property to be specified on the command line?

后端 未结 4 1043
被撕碎了的回忆
被撕碎了的回忆 2020-12-31 02:19

I\'m setting up a maven build, and the destination server needs to be specified on the command line as a property (which is then used to select the appropriate profile), eg<

4条回答
  •  借酒劲吻你
    2020-12-31 02:48

    My first inclination would be to make a Profile that's active whenever the env property is unset, and have it fail somehow. Perhaps you could write a Maven Plugin that tests for that property and fails if it's not present?

    Alternately, you could probably test for it with a very small ant-build script.

提交回复
热议问题