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