1<?xml version="1.0" encoding="UTF-8"?> 2 3<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/maven-v4_0_0.xsd"> 4 <modelVersion>4.0.0</modelVersion> 5 6 <groupId>com.google.code.gson</groupId> 7 <artifactId>gson-parent</artifactId> 8 <version>2.10</version> 9 <packaging>pom</packaging> 10 11 <name>Gson Parent</name> 12 <description>Gson JSON library</description> 13 <url>https://github.com/google/gson</url> 14 15 <modules> 16 <module>gson</module> 17 <module>extras</module> 18 <module>metrics</module> 19 <module>proto</module> 20 </modules> 21 22 <properties> 23 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 24 <maven.compiler.release>7</maven.compiler.release> 25 </properties> 26 27 <scm> 28 <url>https://github.com/google/gson/</url> 29 <connection>scm:git:https://github.com/google/gson.git</connection> 30 <developerConnection>scm:git:git@github.com:google/gson.git</developerConnection> 31 <tag>gson-parent-2.10</tag> 32 </scm> 33 34 <developers> 35 <developer> 36 <organization>Google</organization> 37 <organizationUrl>http://www.google.com</organizationUrl> 38 </developer> 39 </developers> 40 41 <issueManagement> 42 <system>GitHub Issues</system> 43 <url>https://github.com/google/gson/issues</url> 44 </issueManagement> 45 46 <licenses> 47 <license> 48 <name>Apache-2.0</name> 49 <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> 50 </license> 51 </licenses> 52 53 <distributionManagement> 54 <repository> 55 <id>sonatype-nexus-staging</id> 56 <name>Nexus Release Repository</name> 57 <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> 58 </repository> 59 </distributionManagement> 60 61 <dependencyManagement> 62 <dependencies> 63 <dependency> 64 <groupId>junit</groupId> 65 <artifactId>junit</artifactId> 66 <version>4.13.2</version> 67 <scope>test</scope> 68 </dependency> 69 </dependencies> 70 </dependencyManagement> 71 72 <build> 73 <pluginManagement> 74 <plugins> 75 <plugin> 76 <groupId>org.apache.maven.plugins</groupId> 77 <artifactId>maven-compiler-plugin</artifactId> 78 <version>3.10.1</version> 79 <configuration> 80 <showWarnings>true</showWarnings> 81 <showDeprecation>true</showDeprecation> 82 <failOnWarning>true</failOnWarning> 83 <compilerArgs> 84 <!-- Enable all warnings, except for ones which cause issues when building with newer JDKs, see also 85 https://docs.oracle.com/en/java/javase/11/tools/javac.html --> 86 <compilerArg>-Xlint:all,-options</compilerArg> 87 </compilerArgs> 88 <jdkToolchain> 89 <version>[11,)</version> 90 </jdkToolchain> 91 </configuration> 92 </plugin> 93 <plugin> 94 <groupId>org.apache.maven.plugins</groupId> 95 <artifactId>maven-javadoc-plugin</artifactId> 96 <version>3.4.1</version> 97 <configuration> 98 <jdkToolchain> 99 <version>[11,)</version> 100 </jdkToolchain> 101 <!-- Specify newer JDK as target to allow linking to newer Java API, and to generate 102 module overview in Javadoc for Gson's module descriptor --> 103 <release>11</release> 104 <!-- Exclude `missing` group because some tags have been omitted when they are redundant --> 105 <doclint>all,-missing</doclint> 106 <!-- Link against newer Java API Javadoc because most users likely 107 use a newer Java version than the one used for building this project --> 108 <detectJavaApiLink>false</detectJavaApiLink> 109 <links> 110 <link>https://docs.oracle.com/en/java/javase/11/docs/api/</link> 111 </links> 112 <!-- Disable detection of offline links between Maven modules: 113 (1) Only `gson` module is published, so for other modules Javadoc links don't 114 matter much at the moment; (2) The derived URL for the modules is based on 115 the project URL (= Gson GitHub repo) which is incorrect because it is not 116 hosting the Javadoc (3) It might fail due to https://bugs.openjdk.java.net/browse/JDK-8212233 --> 117 <detectOfflineLinks>false</detectOfflineLinks> 118 <!-- Only show warnings and errors --> 119 <quiet>true</quiet> 120 </configuration> 121 </plugin> 122 <plugin> 123 <groupId>org.apache.maven.plugins</groupId> 124 <artifactId>maven-jar-plugin</artifactId> 125 <version>3.3.0</version> 126 </plugin> 127 <plugin> 128 <groupId>org.apache.maven.plugins</groupId> 129 <artifactId>maven-source-plugin</artifactId> 130 <version>3.2.1</version> 131 </plugin> 132 <plugin> 133 <groupId>org.apache.maven.plugins</groupId> 134 <artifactId>maven-gpg-plugin</artifactId> 135 <version>3.0.1</version> 136 </plugin> 137 <plugin> 138 <groupId>org.apache.maven.plugins</groupId> 139 <artifactId>maven-release-plugin</artifactId> 140 <version>3.0.0-M6</version> 141 <configuration> 142 <autoVersionSubmodules>true</autoVersionSubmodules> 143 <!-- Disable Maven Super POM release profile and instead use own one --> 144 <useReleaseProfile>false</useReleaseProfile> 145 <releaseProfiles>release</releaseProfiles> 146 <!-- Run custom goals to replace version references, see plugin configuration below --> 147 <!-- Also run `package`; otherwise goals fail for modules depending on each; possibly 148 same issue as https://issues.apache.org/jira/browse/MRELEASE-271 --> 149 <preparationGoals> 150 package -DskipTests 151 antrun:run@replace-version-placeholders 152 antrun:run@replace-old-version-references 153 antrun:run@git-add-changed 154 </preparationGoals> 155 </configuration> 156 </plugin> 157 <plugin> 158 <artifactId>maven-antrun-plugin</artifactId> 159 <version>3.1.0</version> 160 <executions> 161 <!-- Replaces version placeholders with the current version; this is mainly useful for 162 Javadoc where this allows writing `@since $next-version$` --> 163 <execution> 164 <id>replace-version-placeholders</id> 165 <goals> 166 <goal>run</goal> 167 </goals> 168 <configuration> 169 <target> 170 <replace token="$next-version$" value="${project.version}" encoding="${project.build.sourceEncoding}"> 171 <!-- erroronmissingdir=false for gson-parent which does not have source directory --> 172 <fileset dir="${project.build.sourceDirectory}" includes="**" erroronmissingdir="false" /> 173 </replace> 174 </target> 175 </configuration> 176 </execution> 177 <!-- Replaces references to the old version in the documentation --> 178 <execution> 179 <id>replace-old-version-references</id> 180 <goals> 181 <goal>run</goal> 182 </goals> 183 <configuration> 184 <target> 185 <!-- Replace Maven and Gradle version references; uses regex lookbehind and lookahead --> 186 <replaceregexp match="(?<=<version>).*(?=</version>)|(?<='com\.google\.code\.gson:gson:).*(?=')" flags="g" replace="${project.version}" encoding="${project.build.sourceEncoding}"> 187 <fileset dir="${project.basedir}"> 188 <include name="README.md" /> 189 <include name="UserGuide.md" /> 190 </fileset> 191 </replaceregexp> 192 </target> 193 </configuration> 194 <!-- Only has to be executed for parent project; don't inherit this to modules --> 195 <!-- This might be a bit hacky; execution with this ID seems to be missing for modules and Maven just executes default 196 configuration which does not have any targets configured. (not sure if this behavior is guaranteed) --> 197 <inherited>false</inherited> 198 </execution> 199 <!-- Adds changed files to the Git index; workaround because Maven Release Plugin does not support committing 200 additional files yet (https://issues.apache.org/jira/browse/MRELEASE-798), and for workarounds with 201 Maven SCM Plugin it is apparently necessary to know modified files in advance --> 202 <!-- Maven Release Plugin then just happens to include these changed files in its Git commit; 203 not sure if this behavior is guaranteed or if this relies on implementation details --> 204 <execution> 205 <id>git-add-changed</id> 206 <goals> 207 <goal>run</goal> 208 </goals> 209 <configuration> 210 <target> 211 <exec executable="git" dir="${project.basedir}" failonerror="true"> 212 <arg value="add" /> 213 <arg value="." /> 214 </exec> 215 </target> 216 </configuration> 217 </execution> 218 </executions> 219 </plugin> 220 <!-- Plugin for checking source and binary compatibility; used by GitHub workflow --> 221 <plugin> 222 <groupId>com.github.siom79.japicmp</groupId> 223 <artifactId>japicmp-maven-plugin</artifactId> 224 <version>0.16.0</version> 225 <configuration> 226 <oldVersion> 227 <dependency> 228 <groupId>${project.groupId}</groupId> 229 <artifactId>${project.artifactId}</artifactId> 230 <!-- This is set by the GitHub workflow --> 231 <version>JAPICMP-OLD</version> 232 </dependency> 233 </oldVersion> 234 <newVersion> 235 <file> 236 <path>${project.build.directory}/${project.build.finalName}.${project.packaging}</path> 237 </file> 238 </newVersion> 239 <parameter> 240 <breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications> 241 <breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications> 242 <excludes> 243 <exclude>com.google.gson.internal</exclude> 244 </excludes> 245 <onlyModified>true</onlyModified> 246 <skipXmlReport>true</skipXmlReport> 247 <reportOnlyFilename>true</reportOnlyFilename> 248 </parameter> 249 </configuration> 250 </plugin> 251 </plugins> 252 </pluginManagement> 253 </build> 254 255 <profiles> 256 <!-- Profile defining additional plugins to be executed for release --> 257 <profile> 258 <id>release</id> 259 <build> 260 <plugins> 261 <plugin> 262 <groupId>org.apache.maven.plugins</groupId> 263 <artifactId>maven-source-plugin</artifactId> 264 <executions> 265 <execution> 266 <id>attach-sources</id> 267 <goals> 268 <goal>jar-no-fork</goal> 269 </goals> 270 </execution> 271 </executions> 272 </plugin> 273 <plugin> 274 <groupId>org.apache.maven.plugins</groupId> 275 <artifactId>maven-javadoc-plugin</artifactId> 276 <executions> 277 <execution> 278 <id>attach-javadocs</id> 279 <goals> 280 <goal>jar</goal> 281 </goals> 282 </execution> 283 </executions> 284 </plugin> 285 <plugin> 286 <groupId>org.apache.maven.plugins</groupId> 287 <artifactId>maven-gpg-plugin</artifactId> 288 <executions> 289 <execution> 290 <id>sign-artifacts</id> 291 <phase>verify</phase> 292 <goals> 293 <goal>sign</goal> 294 </goals> 295 </execution> 296 </executions> 297 </plugin> 298 </plugins> 299 </build> 300 </profile> 301 </profiles> 302</project> 303