Skip to content

Commit

Permalink
[LIVY-389][BUILD][FOLLOWUP] Enable generating third-party license by …
Browse files Browse the repository at this point in the history
…profile

Move `license-maven-plugin` to a specific profile which can only be enabled by `-Dlicense-maven-plugin` to avoid generating every time in packaging.

Author: jerryshao <[email protected]>

Closes apache#35 from jerryshao/change-pom.
  • Loading branch information
jerryshao committed Aug 15, 2017
1 parent 2138028 commit ca5b1be
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,26 +1041,6 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<outputDirectory>${execution.root}</outputDirectory>
<thirdPartyFilename>THIRD-PARTY</thirdPartyFilename>
<sortArtifactByName>true</sortArtifactByName>
<fileTemplate>${execution.root}/dev/third-party-file.ftl</fileTemplate>
</configuration>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>aggregate-add-third-party</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

</build>
Expand Down Expand Up @@ -1159,6 +1139,40 @@
</build>
</profile>

<profile>
<!-- This will search remote and local repos to generate THIRD-PARTY license file, make sure
livy artifacts existed in either remote or local repos, otherwise run mvn install before. -->
<id>generate-third-party</id>
<activation>
<property>
<name>generate-third-party</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<outputDirectory>${execution.root}</outputDirectory>
<thirdPartyFilename>THIRD-PARTY</thirdPartyFilename>
<sortArtifactByName>true</sortArtifactByName>
<fileTemplate>${execution.root}/dev/third-party-file.ftl</fileTemplate>
</configuration>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>aggregate-add-third-party</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

0 comments on commit ca5b1be

Please sign in to comment.