Provide bom (bill-of-materials) pom for kotlin libraries
#KT-18398 Fixed
This commit is contained in:
@@ -85,6 +85,8 @@
|
||||
<module>tools/kotlin-maven-sam-with-receiver</module>
|
||||
<module>tools/kotlin-maven-serialization</module>
|
||||
|
||||
<module>tools/kotlin-bom</module>
|
||||
|
||||
<module>tools/kotlin-maven-plugin-test</module>
|
||||
|
||||
<module>examples/kotlin-java-example</module>
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-bom</artifactId>
|
||||
<version>1.3-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<!-- No parent to avoid accidentally inheriting parent's dependencyManagement section -->
|
||||
|
||||
<name>Kotlin Libraries bill-of-materials</name>
|
||||
<description>Kotlin is a statically typed programming language that compiles to JVM byte codes and JavaScript</description>
|
||||
<url>http://kotlinlang.org/</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
<comments>A business-friendly OSS license</comments>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/JetBrains/kotlin</url>
|
||||
<connection>scm:git:https://github.com/JetBrains/kotlin.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/JetBrains/kotlin.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>JetBrains</id>
|
||||
<name>JetBrains Team</name>
|
||||
<organization>JetBrains</organization>
|
||||
<organizationUrl>http://www.jetbrains.com</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
|
||||
<properties>
|
||||
<!--
|
||||
All dependencies listed in this pom will have version same as the version of this pom.
|
||||
|
||||
This property is local to this project,
|
||||
it isn't affected by the same named property in a consumer project,
|
||||
neither it is visible in the consumer project.
|
||||
-->
|
||||
<kotlin.version>${project.version}</kotlin.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- Standard Library -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-stdlib-js</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-stdlib-common</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<!-- Reflection Library -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-reflect</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<!-- OSGI -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-osgi-bundle</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<!-- kotlin.test -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-junit</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-junit5</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-testng</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-js</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-common</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>kotlin-test-annotations-common</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<!--scripting?-->
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
@@ -132,9 +132,14 @@
|
||||
<artifact>org.jetbrains.kotlin:kotlin-stdlib-jdk8:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-reflect:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-common:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-annotations-common:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-junit:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-junit5:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-testng:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-test-js:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-script-util:${project.version}</artifact>
|
||||
<artifact>org.jetbrains.kotlin:kotlin-bom:${project.version}:pom</artifact>
|
||||
</extraArtifacts>
|
||||
<showErrors>true</showErrors>
|
||||
<postBuildHookScript>verify</postBuildHookScript>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
invoker.goals=dependency:tree package
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>test-kotlin-bom</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-bom</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-js</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-common</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Depend on some artifact which itself depends on the old kotlin-reflect -->
|
||||
<!-- And expect newer version of kotlin-reflect to be selected -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.module</groupId>
|
||||
<artifactId>jackson-module-kotlin</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${kotlin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>process-sources</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<phase>process-test-sources</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
||||
File file = new File(basedir, "target/test-kotlin-bom-1.0-SNAPSHOT.jar")
|
||||
if (!file.exists() || !file.isFile()) {
|
||||
throw new FileNotFoundException("Could not find generated JAR: " + file)
|
||||
}
|
||||
|
||||
String expectedDependency = "org.jetbrains.kotlin:kotlin-reflect:jar:$kotlinVersion:compile"
|
||||
List<String> lines = new File(basedir, "build.log").readLines()
|
||||
|
||||
if (!lines.any { it.contains(expectedDependency) }) {
|
||||
throw new Exception("Expected to find dependency '$expectedDependency' in dependency tree")
|
||||
}
|
||||
Reference in New Issue
Block a user