I am using the maven-shade-plugin in my pom.xml and I want to be able to dynamically set the <outputFile />
from the command line, something like this:
mvn -outputFile=C:/Users/Oscar/Desktop/MyJar.jar
I don't want to hardcode a filepath directly in the pom.xml because I don't want it in the repo. On our production server, I want to be able to specify an output path for the shaded jar and on my local development machine I want to be able to specify my own path.
Is it possible to do something like this?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>io.github.hornta.lib.hikari</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>io.github.hornta.lib.gson</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>io.github.hornta.lib.slf4j</shadedPattern>
</relocation>
<relocation>
<pattern>org.flywaydb.core</pattern>
<shadedPattern>io.github.hornta.lib.flywaydb</shadedPattern>
</relocation>
</relocations>
<outputFile>I NEED TO SET THIS PATH FROM COMMAND LINE (not having it in the repo)</outputFile>
</configuration>
</execution>
</executions>
</plugin>