Last active
May 30, 2018 08:09
-
-
Save rybalkinsd/5ff2aec6075e581a467aa49156ed2172 to your computer and use it in GitHub Desktop.
Maven Build Stage for project with mixed Kotlin & Java codebaze without parent pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<finalName>project-name</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-maven-plugin</artifactId> | |
<version>${spring-boot.version}</version> | |
<configuration> | |
<executable>false</executable> | |
<excludeDevtools>true</excludeDevtools> | |
<mainClass>com.MainClass</mainClass> | |
</configuration> | |
</plugin> | |
<plugin> | |
<artifactId>kotlin-maven-plugin</artifactId> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<version>${kotlin.version}</version> | |
<configuration> | |
<args><arg>-Xjsr305=strict</arg></args> | |
<jvmTarget>1.8</jvmTarget> | |
<compilerPlugins><plugin>spring</plugin></compilerPlugins> | |
</configuration> | |
<executions> | |
<execution> | |
<id>compile</id> | |
<goals> <goal>compile</goal> </goals> | |
<configuration> | |
<sourceDirs> | |
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir> | |
<sourceDir>${project.basedir}/src/main/java</sourceDir> | |
</sourceDirs> | |
</configuration> | |
</execution> | |
<execution> | |
<id>test-compile</id> | |
<goals> <goal>test-compile</goal> </goals> | |
<configuration> | |
<sourceDirs> | |
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir> | |
<sourceDir>${project.basedir}/src/test/java</sourceDir> | |
</sourceDirs> | |
</configuration> | |
</execution> | |
</executions> | |
<dependencies> | |
<dependency> | |
<groupId>org.jetbrains.kotlin</groupId> | |
<artifactId>kotlin-maven-allopen</artifactId> | |
<version>${kotlin.version}</version> | |
</dependency> | |
</dependencies> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>default-compile</id> | |
<phase>none</phase> | |
</execution> | |
<execution> | |
<id>default-testCompile</id> | |
<phase>none</phase> | |
</execution> | |
<execution> | |
<id>java-compile</id> | |
<phase>compile</phase> | |
<goals> <goal>compile</goal> </goals> | |
</execution> | |
<execution> | |
<id>java-test-compile</id> | |
<phase>test-compile</phase> | |
<goals> <goal>testCompile</goal> </goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment