• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3  ~ Copyright 2015 Google Inc.
4  ~
5  ~ Licensed under the Apache License, Version 2.0 (the "License");
6  ~ you may not use this file except in compliance with the License.
7  ~ You may obtain a copy of the License at
8  ~
9  ~     http://www.apache.org/licenses/LICENSE-2.0
10  ~
11  ~ Unless required by applicable law or agreed to in writing, software
12  ~ distributed under the License is distributed on an "AS IS" BASIS,
13  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ~ See the License for the specific language governing permissions and
15  ~ limitations under the License.
16  -->
17
18<project xmlns="http://maven.apache.org/POM/4.0.0"
19         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21  <modelVersion>4.0.0</modelVersion>
22  <parent>
23    <groupId>com.google.googlejavaformat</groupId>
24    <artifactId>google-java-format-parent</artifactId>
25  <version>HEAD-SNAPSHOT</version>
26  </parent>
27
28  <artifactId>google-java-format</artifactId>
29
30  <name>Google Java Format</name>
31
32  <description>
33    A Java source code formatter that follows Google Java Style.
34  </description>
35
36  <dependencies>
37    <!-- Required runtime dependencies -->
38    <dependency>
39      <groupId>com.google.guava</groupId>
40      <artifactId>guava</artifactId>
41    </dependency>
42
43    <!-- Compile-time dependencies -->
44    <dependency>
45      <groupId>org.checkerframework</groupId>
46      <artifactId>checker-qual</artifactId>
47      <optional>true</optional>
48    </dependency>
49    <dependency>
50      <groupId>com.google.errorprone</groupId>
51      <artifactId>error_prone_annotations</artifactId>
52      <optional>true</optional>
53    </dependency>
54    <dependency>
55      <groupId>com.google.auto.value</groupId>
56      <artifactId>auto-value-annotations</artifactId>
57      <optional>true</optional>
58    </dependency>
59    <dependency>
60      <groupId>com.google.auto.service</groupId>
61      <artifactId>auto-service-annotations</artifactId>
62      <optional>true</optional>
63    </dependency>
64
65    <!-- Test dependencies -->
66    <dependency>
67      <groupId>junit</groupId>
68      <artifactId>junit</artifactId>
69    </dependency>
70    <dependency>
71      <groupId>com.google.guava</groupId>
72      <artifactId>guava-testlib</artifactId>
73    </dependency>
74    <dependency>
75      <groupId>com.google.truth</groupId>
76      <artifactId>truth</artifactId>
77    </dependency>
78    <dependency>
79      <groupId>com.google.truth.extensions</groupId>
80      <artifactId>truth-java8-extension</artifactId>
81      <scope>test</scope>
82    </dependency>
83    <dependency>
84      <groupId>com.google.testing.compile</groupId>
85      <artifactId>compile-testing</artifactId>
86      <version>0.19</version>
87      <scope>test</scope>
88    </dependency>
89  </dependencies>
90
91  <build>
92    <plugins>
93      <plugin>
94        <artifactId>maven-javadoc-plugin</artifactId>
95        <configuration>
96          <source>11</source>
97          <encoding>UTF-8</encoding>
98          <docencoding>UTF-8</docencoding>
99          <charset>UTF-8</charset>
100          <links>
101            <link>https://guava.dev/releases/${guava.version}/api/docs/</link>
102            <link>https://docs.oracle.com/en/java/javase/11/docs/api</link>
103          </links>
104          <additionalJOptions>
105            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
106            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
107            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
108            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
109            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
110            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
111            <additionalJOption>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,com.google.googlejavaformat</additionalJOption>
112          </additionalJOptions>
113        </configuration>
114        <executions>
115          <execution>
116            <id>attach-docs</id>
117            <phase>post-integration-test</phase>
118            <goals>
119              <goal>jar</goal>
120            </goals>
121          </execution>
122        </executions>
123      </plugin>
124      <plugin>
125        <groupId>org.apache.maven.plugins</groupId>
126        <artifactId>maven-shade-plugin</artifactId>
127        <version>3.2.4</version>
128        <executions>
129          <execution>
130            <id>shade-all-deps</id>
131            <phase>package</phase>
132            <goals>
133              <goal>shade</goal>
134            </goals>
135            <configuration>
136              <shadedArtifactAttached>true</shadedArtifactAttached>
137              <shadedClassifierName>all-deps</shadedClassifierName>
138              <createDependencyReducedPom>false</createDependencyReducedPom>
139              <!-- http://stackoverflow.com/a/6743609 -->
140              <filters>
141                <filter>
142                  <artifact>*:*</artifact>
143                  <excludes>
144                    <exclude>META-INF/*.SF</exclude>
145                    <exclude>META-INF/*.DSA</exclude>
146                    <exclude>META-INF/*.RSA</exclude>
147                  </excludes>
148                </filter>
149              </filters>
150            </configuration>
151          </execution>
152        </executions>
153      </plugin>
154      <plugin>
155        <groupId>org.apache.maven.plugins</groupId>
156        <artifactId>maven-jar-plugin</artifactId>
157        <configuration>
158          <archive>
159            <manifest>
160              <mainClass>com.google.googlejavaformat.java.Main</mainClass>
161              <addDefaultImplementationEntries>
162                true
163              </addDefaultImplementationEntries>
164            </manifest>
165            <manifestEntries>
166              <Automatic-Module-Name>
167                com.google.googlejavaformat
168              </Automatic-Module-Name>
169            </manifestEntries>
170          </archive>
171        </configuration>
172      </plugin>
173      <plugin>
174        <groupId>com.google.code.maven-replacer-plugin</groupId>
175        <artifactId>replacer</artifactId>
176        <version>1.5.3</version>
177        <executions>
178          <execution>
179            <phase>generate-sources</phase>
180            <goals>
181              <goal>replace</goal>
182            </goals>
183          </execution>
184        </executions>
185        <configuration>
186          <file>${project.basedir}/src/main/java/com/google/googlejavaformat/java/GoogleJavaFormatVersion.java.template</file>
187          <outputFile>${project.build.directory}/generated-sources/java/com/google/googlejavaformat/java/GoogleJavaFormatVersion.java</outputFile>
188          <replacements>
189            <replacement>
190              <token>%VERSION%</token>
191              <value>${project.version}</value>
192            </replacement>
193          </replacements>
194        </configuration>
195      </plugin>
196      <plugin>
197        <groupId>org.codehaus.mojo</groupId>
198        <artifactId>build-helper-maven-plugin</artifactId>
199        <version>3.3.0</version>
200        <executions>
201          <execution>
202            <id>add-source</id>
203            <phase>generate-sources</phase>
204            <goals>
205              <goal>add-source</goal>
206            </goals>
207            <configuration>
208              <sources>
209                <source>${project.build.directory}/generated-sources/java/</source>
210              </sources>
211            </configuration>
212          </execution>
213        </executions>
214      </plugin>
215      <plugin>
216        <groupId>org.apache.maven.plugins</groupId>
217        <artifactId>maven-compiler-plugin</artifactId>
218        <configuration>
219          <source>11</source>
220          <target>11</target>
221        </configuration>
222      </plugin>
223    </plugins>
224  </build>
225
226  <profiles>
227    <profile>
228      <id>jdk11</id>
229      <activation>
230        <jdk>(,14)</jdk>
231      </activation>
232      <build>
233        <plugins>
234          <plugin>
235            <groupId>org.apache.maven.plugins</groupId>
236            <artifactId>maven-compiler-plugin</artifactId>
237            <configuration>
238              <excludes>
239                <exclude>**/Java14InputAstVisitor.java</exclude>
240              </excludes>
241            </configuration>
242          </plugin>
243          <plugin>
244            <artifactId>maven-javadoc-plugin</artifactId>
245            <configuration>
246              <excludePackageNames>com.google.googlejavaformat.java.java14</excludePackageNames>
247            </configuration>
248          </plugin>
249        </plugins>
250      </build>
251    </profile>
252    <profile>
253      <id>native</id>
254      <build>
255        <plugins>
256          <plugin>
257            <groupId>org.graalvm.buildtools</groupId>
258            <artifactId>native-maven-plugin</artifactId>
259            <version>0.9.9</version>
260            <extensions>true</extensions>
261            <executions>
262              <execution>
263                <id>build-native</id>
264                <goals>
265                  <goal>build</goal>
266                </goals>
267                <phase>package</phase>
268              </execution>
269              <execution>
270                <id>test-native</id>
271                <goals>
272                  <goal>test</goal>
273                </goals>
274                <phase>test</phase>
275              </execution>
276            </executions>
277            <configuration>
278              <imageName>google-java-format</imageName>
279              <classpath>
280                <param>${project.build.directory}/${project.artifactId}-${project.version}-all-deps.jar</param>
281              </classpath>
282              <buildArgs>
283                <buildArg>-H:IncludeResourceBundles=com.sun.tools.javac.resources.compiler</buildArg>
284                <buildArg>--no-fallback</buildArg>
285                <buildArg>--initialize-at-build-time=com.sun.tools.javac.file.Locations</buildArg>
286              </buildArgs>
287            </configuration>
288          </plugin>
289        </plugins>
290      </build>
291    </profile>
292  </profiles>
293</project>
294