|
11 | 11 |
|
12 | 12 | <properties> |
13 | 13 | <kotlin.version>1.0.1-2</kotlin.version> |
14 | | - <junit.version>4.10</junit.version> |
15 | | - |
| 14 | + <junit.version>4.12</junit.version> |
| 15 | + <main.class>kotlin.KotlinHelloKt</main.class> |
16 | 16 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
17 | 17 | </properties> |
18 | 18 |
|
|
43 | 43 | <artifactId>kotlin-maven-plugin</artifactId> |
44 | 44 | <groupId>org.jetbrains.kotlin</groupId> |
45 | 45 | <version>${kotlin.version}</version> |
46 | | - |
47 | | - <configuration/> |
48 | 46 | <executions> |
49 | 47 | <execution> |
50 | 48 | <id>compile</id> |
51 | | - <phase>process-sources</phase> |
52 | | - <goals> |
53 | | - <goal>compile</goal> |
54 | | - </goals> |
| 49 | + <goals> <goal>compile</goal> </goals> |
| 50 | + <configuration> |
| 51 | + <sourceDirs> |
| 52 | + <sourceDir>${project.basedir}/src/main/kotlin</sourceDir> |
| 53 | + <sourceDir>${project.basedir}/src/main/java</sourceDir> |
| 54 | + </sourceDirs> |
| 55 | + </configuration> |
55 | 56 | </execution> |
56 | 57 | <execution> |
57 | 58 | <id>test-compile</id> |
58 | | - <phase>process-test-sources</phase> |
59 | | - <goals> |
60 | | - <goal>test-compile</goal> |
61 | | - </goals> |
| 59 | + <goals> <goal>test-compile</goal> </goals> |
| 60 | + <configuration> |
| 61 | + <sourceDirs> |
| 62 | + <sourceDir>${project.basedir}/src/test/kotlin</sourceDir> |
| 63 | + <sourceDir>${project.basedir}/src/test/java</sourceDir> |
| 64 | + </sourceDirs> |
| 65 | + </configuration> |
| 66 | + </execution> |
| 67 | + </executions> |
| 68 | + </plugin> |
| 69 | + <plugin> |
| 70 | + <groupId>org.apache.maven.plugins</groupId> |
| 71 | + <artifactId>maven-compiler-plugin</artifactId> |
| 72 | + <version>3.5.1</version> |
| 73 | + <executions> |
| 74 | + <!-- Replacing default-compile as it is treated specially by maven --> |
| 75 | + <execution> |
| 76 | + <id>default-compile</id> |
| 77 | + <phase>none</phase> |
| 78 | + </execution> |
| 79 | + <!-- Replacing default-testCompile as it is treated specially by maven --> |
| 80 | + <execution> |
| 81 | + <id>default-testCompile</id> |
| 82 | + <phase>none</phase> |
| 83 | + </execution> |
| 84 | + <execution> |
| 85 | + <id>java-compile</id> |
| 86 | + <phase>compile</phase> |
| 87 | + <goals> <goal>compile</goal> </goals> |
| 88 | + </execution> |
| 89 | + <execution> |
| 90 | + <id>java-test-compile</id> |
| 91 | + <phase>test-compile</phase> |
| 92 | + <goals> <goal>testCompile</goal> </goals> |
| 93 | + </execution> |
| 94 | + </executions> |
| 95 | + </plugin> |
| 96 | + <plugin> |
| 97 | + <groupId>org.apache.maven.plugins</groupId> |
| 98 | + <artifactId>maven-jar-plugin</artifactId> |
| 99 | + <version>2.6</version> |
| 100 | + <configuration> |
| 101 | + <archive> |
| 102 | + <manifest> |
| 103 | + <addClasspath>true</addClasspath> |
| 104 | + <mainClass>${main.class}</mainClass> |
| 105 | + </manifest> |
| 106 | + </archive> |
| 107 | + </configuration> |
| 108 | + </plugin> |
| 109 | + <plugin> |
| 110 | + <groupId>org.apache.maven.plugins</groupId> |
| 111 | + <artifactId>maven-assembly-plugin</artifactId> |
| 112 | + <version>2.6</version> |
| 113 | + <executions> |
| 114 | + <execution> |
| 115 | + <id>make-assembly</id> |
| 116 | + <phase>package</phase> |
| 117 | + <goals> <goal>single</goal> </goals> |
| 118 | + <configuration> |
| 119 | + <archive> |
| 120 | + <manifest> |
| 121 | + <mainClass>${main.class}</mainClass> |
| 122 | + </manifest> |
| 123 | + </archive> |
| 124 | + <descriptorRefs> |
| 125 | + <descriptorRef>jar-with-dependencies</descriptorRef> |
| 126 | + </descriptorRefs> |
| 127 | + </configuration> |
62 | 128 | </execution> |
63 | 129 | </executions> |
64 | 130 | </plugin> |
|
0 commit comments