|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!-- |
| 3 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 | + contributor license agreements. See the NOTICE file distributed with |
| 5 | + this work for additional information regarding copyright ownership. |
| 6 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 7 | + (the "License"); you may not use this file except in compliance with |
| 8 | + the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +--> |
| 18 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 19 | + <modelVersion>4.0.0</modelVersion> |
| 20 | + <parent> |
| 21 | + <groupId>org.apache.rat</groupId> |
| 22 | + <artifactId>apache-rat-project</artifactId> |
| 23 | + <version>1.0.0-SNAPSHOT</version> |
| 24 | + </parent> |
| 25 | + <!-- |
| 26 | + This artifact ID has to be the Gradle plugin ID |
| 27 | + TODO VERIFY AGAIN !! |
| 28 | + TODO add an integration test !! |
| 29 | + --> |
| 30 | + <artifactId>org.apache.rat.gradle-plugin</artifactId> |
| 31 | + <packaging>pom</packaging> |
| 32 | + <name>Apache Creadur RAT::Gradle Plugin</name> |
| 33 | + <description>Gradle plugin.</description> |
| 34 | + <properties> |
| 35 | + <gradle.task>build</gradle.task> |
| 36 | + <skip.gradle.build>false</skip.gradle.build> |
| 37 | + <artifactPrefix>apache-rat-gradle-plugin</artifactPrefix> |
| 38 | + </properties> |
| 39 | + <dependencies> |
| 40 | + <dependency> |
| 41 | + <groupId>org.apache.rat</groupId> |
| 42 | + <artifactId>apache-rat-core</artifactId> |
| 43 | + </dependency> |
| 44 | + <dependency> |
| 45 | + <groupId>org.apache.rat</groupId> |
| 46 | + <artifactId>apache-rat-tools</artifactId> |
| 47 | + </dependency> |
| 48 | + </dependencies> |
| 49 | + <build> |
| 50 | + <pluginManagement> |
| 51 | + <plugins> |
| 52 | + <plugin> |
| 53 | + <groupId>org.apache.rat</groupId> |
| 54 | + <artifactId>apache-rat-plugin</artifactId> |
| 55 | + <configuration> |
| 56 | + <inputExcludes> |
| 57 | + <exclude>build/**</exclude> |
| 58 | + <exclude>gradle/wrapper/gradle-wrapper.jar</exclude> |
| 59 | + <exclude>gradle/wrapper/gradle-wrapper*.sha256</exclude> |
| 60 | + <!-- exclude the definition file(s) --> |
| 61 | + <exclude>**/default.xml</exclude> |
| 62 | + <exclude>**/example-configuration.xml</exclude> |
| 63 | + <!-- exclude test generation files that contain unapproved license text --> |
| 64 | + <exclude>**/ReporterOptionsProvider.java</exclude> |
| 65 | + <exclude>**/GPLLicenseTest.java</exclude> |
| 66 | + <!-- These files have bad license headers because they are used to test bad license headers --> |
| 67 | + <exclude>src/test/resources/**</exclude> |
| 68 | + <exclude>src/it/resources/ReportTest/**</exclude> |
| 69 | + </inputExcludes> |
| 70 | + </configuration> |
| 71 | + </plugin> |
| 72 | + </plugins> |
| 73 | + </pluginManagement> |
| 74 | + <plugins> |
| 75 | + <plugin> |
| 76 | + <groupId>org.codehaus.mojo</groupId> |
| 77 | + <artifactId>exec-maven-plugin</artifactId> |
| 78 | + <executions> |
| 79 | + <execution> |
| 80 | + <id>gradle</id> |
| 81 | + <phase>prepare-package</phase> |
| 82 | + <configuration> |
| 83 | + <executable>./gradlew</executable> |
| 84 | + <arguments> |
| 85 | + <argument>clean</argument> |
| 86 | + <argument>${gradle.task}</argument> |
| 87 | + <argument>-Pdescription=${project.description}</argument> |
| 88 | + <argument>-Dmaven.repo.local=${settings.localRepository}</argument> |
| 89 | + <argument>-S</argument> |
| 90 | + <argument>--stacktrace</argument> |
| 91 | + </arguments> |
| 92 | + <environmentVariables> |
| 93 | + <MAVEN_REPO_LOCAL>${settings.localRepository}</MAVEN_REPO_LOCAL> |
| 94 | + <GRADLE_OPTS>${env.MAVEN_OPTS}</GRADLE_OPTS> |
| 95 | + <JAVA_HOME>${gradleJavaHome}</JAVA_HOME> |
| 96 | + </environmentVariables> |
| 97 | + <skip>${skip.gradle.build}</skip> |
| 98 | + </configuration> |
| 99 | + <goals> |
| 100 | + <goal>exec</goal> |
| 101 | + </goals> |
| 102 | + </execution> |
| 103 | + </executions> |
| 104 | + </plugin> |
| 105 | + <plugin> |
| 106 | + <groupId>org.codehaus.mojo</groupId> |
| 107 | + <artifactId>build-helper-maven-plugin</artifactId> |
| 108 | + <executions> |
| 109 | + <execution> |
| 110 | + <id>attach-artifacts</id> |
| 111 | + <phase>package</phase> |
| 112 | + <goals> |
| 113 | + <goal>attach-artifact</goal> |
| 114 | + </goals> |
| 115 | + <configuration> |
| 116 | + <artifacts> |
| 117 | + <artifact> |
| 118 | + <file>build/libs/${artifactPrefix}-${project.version}.jar</file> |
| 119 | + <type>jar</type> |
| 120 | + </artifact> |
| 121 | + <artifact> |
| 122 | + <file>build/libs/${artifactPrefix}-${project.version}-javadoc.jar</file> |
| 123 | + <type>jar</type> |
| 124 | + <classifier>javadoc</classifier> |
| 125 | + </artifact> |
| 126 | + <artifact> |
| 127 | + <file>build/libs/${artifactPrefix}-${project.version}-sources.jar</file> |
| 128 | + <type>jar</type> |
| 129 | + <classifier>sources</classifier> |
| 130 | + </artifact> |
| 131 | + </artifacts> |
| 132 | + <skipAttach>${skip.gradle.build}</skipAttach> |
| 133 | + </configuration> |
| 134 | + </execution> |
| 135 | + </executions> |
| 136 | + </plugin> |
| 137 | + <plugin> |
| 138 | + <groupId>org.apache.maven.plugins</groupId> |
| 139 | + <artifactId>maven-jar-plugin</artifactId> |
| 140 | + <executions> |
| 141 | + <execution> |
| 142 | + <goals> |
| 143 | + <goal>test-jar</goal> |
| 144 | + </goals> |
| 145 | + </execution> |
| 146 | + </executions> |
| 147 | + </plugin> |
| 148 | + <!-- |
| 149 | + TODO enable when code-style's adopted |
| 150 | + <plugin> |
| 151 | + <groupId>org.apache.maven.plugins</groupId> |
| 152 | + <artifactId>maven-checkstyle-plugin</artifactId> |
| 153 | + <configuration> |
| 154 | + <consoleOutput>true</consoleOutput> |
| 155 | + <failsOnError>true</failsOnError> |
| 156 | + <failOnViolation>true</failOnViolation> |
| 157 | + <violationSeverity>warning</violationSeverity> |
| 158 | + <excludeGeneratedSources>true</excludeGeneratedSources> |
| 159 | + <configLocation>../src/conf/checkstyle.xml</configLocation> |
| 160 | + <suppressionsLocation>../src/conf/checkstyle-suppressions.xml</suppressionsLocation> |
| 161 | + </configuration> |
| 162 | + <executions> |
| 163 | + <execution> |
| 164 | + <goals> |
| 165 | + <goal>check</goal> |
| 166 | + </goals> |
| 167 | + <phase>compile</phase> |
| 168 | + </execution> |
| 169 | + </executions> |
| 170 | + </plugin> |
| 171 | + --> |
| 172 | + </plugins> |
| 173 | + </build> |
| 174 | + <profiles> |
| 175 | + <profile> |
| 176 | + <id>skipTests</id> |
| 177 | + <activation> |
| 178 | + <property> |
| 179 | + <name>skipTests</name> |
| 180 | + <value>true</value> |
| 181 | + </property> |
| 182 | + </activation> |
| 183 | + <properties> |
| 184 | + <gradle.task>assemble</gradle.task> |
| 185 | + </properties> |
| 186 | + </profile> |
| 187 | + <profile> |
| 188 | + <id>gradleJavaHomeSet</id> |
| 189 | + <activation> |
| 190 | + <property> |
| 191 | + <name>env.GRADLE_JAVA_HOME</name> |
| 192 | + </property> |
| 193 | + </activation> |
| 194 | + <properties> |
| 195 | + <gradleJavaHome>${env.GRADLE_JAVA_HOME}</gradleJavaHome> |
| 196 | + </properties> |
| 197 | + </profile> |
| 198 | + <profile> |
| 199 | + <id>gradleJavaHomeNotSet</id> |
| 200 | + <activation> |
| 201 | + <property> |
| 202 | + <name>!env.GRADLE_JAVA_HOME</name> |
| 203 | + </property> |
| 204 | + </activation> |
| 205 | + <properties> |
| 206 | + <gradleJavaHome>${env.JAVA_HOME}</gradleJavaHome> |
| 207 | + </properties> |
| 208 | + </profile> |
| 209 | + </profiles> |
| 210 | +</project> |
0 commit comments