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