• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<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">
3  <modelVersion>4.0.0</modelVersion>
4
5  <parent>
6    <groupId>com.facebook</groupId>
7    <artifactId>ktfmt-parent</artifactId>
8    <version>0.54</version>
9  </parent>
10
11  <artifactId>ktfmt</artifactId>
12
13  <name>Ktfmt</name>
14  <description>A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.</description>
15
16  <distributionManagement>
17    <snapshotRepository>
18      <id>ossrh</id>
19      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
20    </snapshotRepository>
21  </distributionManagement>
22
23  <properties>
24    <dokka.version>0.10.1</dokka.version>
25    <kotlin.version>2.0.0</kotlin.version>
26    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
27    <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
28    <main.class>com.facebook.ktfmt.cli.Main</main.class>
29  </properties>
30
31  <dependencies>
32    <dependency>
33      <groupId>com.google.guava</groupId>
34      <artifactId>guava</artifactId>
35      <version>32.0.0-jre</version>
36    </dependency>
37    <dependency>
38      <groupId>org.jetbrains.kotlin</groupId>
39      <artifactId>kotlin-stdlib-jdk7</artifactId>
40      <version>${kotlin.version}</version>
41    </dependency>
42    <dependency>
43      <groupId>org.jetbrains.kotlin</groupId>
44      <artifactId>kotlin-test</artifactId>
45      <version>${kotlin.version}</version>
46    </dependency>
47    <dependency>
48      <groupId>org.jetbrains.kotlin</groupId>
49      <artifactId>kotlin-compiler-embeddable</artifactId>
50      <version>${kotlin.version}</version>
51    </dependency>
52    <!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
53    <dependency>
54      <groupId>net.java.dev.jna</groupId>
55      <artifactId>jna</artifactId>
56      <version>4.2.2</version>
57    </dependency>
58    <dependency>
59      <groupId>com.google.googlejavaformat</groupId>
60      <artifactId>google-java-format</artifactId>
61      <version>1.23.0</version>
62    </dependency>
63    <dependency>
64      <groupId>junit</groupId>
65      <artifactId>junit</artifactId>
66      <version>4.13.1</version>
67      <scope>test</scope>
68    </dependency>
69    <dependency>
70      <groupId>com.google.truth</groupId>
71      <artifactId>truth</artifactId>
72      <version>1.0</version>
73      <scope>test</scope>
74    </dependency>
75  </dependencies>
76
77  <pluginRepositories>
78    <pluginRepository>
79      <id>jcenter</id>
80      <name>JCenter</name>
81      <url>https://jcenter.bintray.com/</url>
82    </pluginRepository>
83  </pluginRepositories>
84
85  <build>
86    <plugins>
87      <!-- Spotless for formatting -->
88      <plugin>
89        <groupId>com.diffplug.spotless</groupId>
90        <artifactId>spotless-maven-plugin</artifactId>
91      </plugin>
92
93      <plugin>
94        <groupId>org.jetbrains.kotlin</groupId>
95        <artifactId>kotlin-maven-plugin</artifactId>
96        <version>${kotlin.version}</version>
97
98        <executions>
99          <execution>
100            <id>compile</id>
101            <goals>
102              <goal>compile</goal>
103            </goals>
104            <configuration>
105              <sourceDirs>
106                <sourceDir>${project.basedir}/src/main/java</sourceDir>
107              </sourceDirs>
108            </configuration>
109          </execution>
110
111          <execution>
112            <id>test-compile</id>
113            <goals>
114              <goal>test-compile</goal>
115            </goals>
116            <configuration>
117              <sourceDirs>
118                <sourceDir>${project.basedir}/src/test/java</sourceDir>
119              </sourceDirs>
120            </configuration>
121          </execution>
122        </executions>
123      </plugin>
124      <plugin>
125        <groupId>org.apache.maven.plugins</groupId>
126        <artifactId>maven-compiler-plugin</artifactId>
127        <version>3.5.1</version>
128        <configuration>
129          <source>1.8</source>
130          <target>1.8</target>
131        </configuration>
132        <executions>
133          <!-- Replacing default-compile as it is treated specially by maven -->
134          <execution>
135            <id>default-compile</id>
136            <phase>none</phase>
137          </execution>
138          <!-- Replacing default-testCompile as it is treated specially by maven -->
139          <execution>
140            <id>default-testCompile</id>
141            <phase>none</phase>
142          </execution>
143          <execution>
144            <id>java-compile</id>
145            <goals>
146              <goal>compile</goal>
147            </goals>
148            <phase>compile</phase>
149          </execution>
150          <execution>
151            <id>java-test-compile</id>
152            <goals>
153              <goal>testCompile</goal>
154            </goals>
155            <phase>test-compile</phase>
156          </execution>
157        </executions>
158      </plugin>
159      <plugin>
160        <groupId>org.apache.maven.plugins</groupId>
161        <artifactId>maven-jar-plugin</artifactId>
162        <version>3.3.0</version>
163        <configuration>
164          <archive>
165            <manifest>
166              <addClasspath>true</addClasspath>
167              <mainClass>${main.class}</mainClass>
168            </manifest>
169          </archive>
170        </configuration>
171      </plugin>
172      <plugin>
173        <groupId>org.apache.maven.plugins</groupId>
174        <artifactId>maven-assembly-plugin</artifactId>
175        <version>3.3.0</version>
176        <executions>
177          <execution>
178            <id>make-assembly</id>
179            <goals>
180              <goal>single</goal>
181            </goals>
182            <phase>package</phase>
183            <configuration>
184              <archive>
185                <manifest>
186                  <mainClass>${main.class}</mainClass>
187                </manifest>
188              </archive>
189              <descriptorRefs>
190                <descriptorRef>jar-with-dependencies</descriptorRef>
191              </descriptorRefs>
192            </configuration>
193          </execution>
194        </executions>
195      </plugin>
196      <plugin>
197        <groupId>org.apache.maven.plugins</groupId>
198        <artifactId>maven-surefire-plugin</artifactId>
199        <version>3.2.5</version>
200        <configuration>
201          <!-- Tests that everything works when using an unusual default Charset. -->
202          <argLine>-Dfile.encoding=UTF-16</argLine>
203        </configuration>
204      </plugin>
205    </plugins>
206    <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
207    <testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
208  </build>
209
210  <profiles>
211    <profile>
212      <id>release</id>
213      <build>
214        <plugins>
215          <plugin>
216            <groupId>org.sonatype.plugins</groupId>
217            <artifactId>nexus-staging-maven-plugin</artifactId>
218            <version>1.7.0</version>
219            <extensions>true</extensions>
220            <configuration>
221              <serverId>ossrh</serverId>
222              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
223              <autoReleaseAfterClose>true</autoReleaseAfterClose>
224            </configuration>
225          </plugin>
226
227          <!-- Source JAR -->
228          <plugin>
229            <groupId>org.apache.maven.plugins</groupId>
230            <artifactId>maven-source-plugin</artifactId>
231            <version>2.2.1</version>
232            <executions>
233              <execution>
234                <id>attach-sources</id>
235                <goals>
236                  <goal>jar-no-fork</goal>
237                </goals>
238              </execution>
239            </executions>
240          </plugin>
241
242          <!-- Javadoc JAR -->
243          <!-- Dokka, Kotlin's javadoc, doesn't work on JDK 10+, so we're creating an empty javadoc jar instead. -->
244          <!-- (https://github.com/Kotlin/dokka/issues/294) -->
245          <plugin>
246            <groupId>org.apache.maven.plugins</groupId>
247            <artifactId>maven-jar-plugin</artifactId>
248            <executions>
249              <execution>
250                <goals>
251                  <goal>jar</goal>
252                </goals>
253                <phase>package</phase>
254                <configuration>
255                  <classifier>javadoc</classifier>
256                  <classesDirectory>${project.basedir}/non/existing/dir</classesDirectory>
257                </configuration>
258              </execution>
259            </executions>
260          </plugin>
261
262          <!-- Sign artifacts -->
263          <plugin>
264            <groupId>org.apache.maven.plugins</groupId>
265            <artifactId>maven-gpg-plugin</artifactId>
266            <version>1.6</version>
267            <executions>
268              <execution>
269                <id>sign-artifacts</id>
270                <goals>
271                  <goal>sign</goal>
272                </goals>
273                <phase>verify</phase>
274                <configuration>
275                  <!-- Honor -Dgpg.passphrase=... on the command line. -->
276                  <gpgArguments>
277                    <arg>--pinentry-mode</arg>
278                    <arg>loopback</arg>
279                  </gpgArguments>
280                </configuration>
281              </execution>
282            </executions>
283          </plugin>
284        </plugins>
285      </build>
286    </profile>
287  </profiles>
288
289</project>
290