Can I tailor a maven build based on platform?

前端 未结 1 810
情深已故
情深已故 2020-12-12 03:37

Specifically, I run the launch4j-maven-plugin plugin to generate me an .exe file. This only works on Windows, so I was wondering if I could \'opt-o

相关标签:
1条回答
  • 2020-12-12 04:24

    You can wrap that plugin under separate build profile and just enable that profile on the build that you want

    For example:

    <project>
      ...
    <profile>
    <id>generate-exe</id>
      <build>
        <plugins>
          <plugin>
            <!_- your plugin configuration -->
          </plugin>
          ...
        </plugins>
      </build>
    </profile>
      ...
    </project>
    

    Now pass parameter while launching maven to specify profile

    For example:

    mvn clean install -Pgenerate-exe
    
    0 讨论(0)
提交回复
热议问题