This commit is contained in:
Stephane Nicoll
2018-12-11 09:54:24 +01:00
parent 87b6a320fc
commit c3079c5609
21 changed files with 265 additions and 32 deletions

View File

@@ -43,17 +43,17 @@
<artifactId>groovy</artifactId>
</dependency>
{{/groovy}}
{{#kotlin}}
{{#kotlin}}
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>{{kotlinStdlibArtifactId}}</artifactId>
<artifactId>kotlin-reflect</artifactId>
{{^kotlinSupport}}
<version>${kotlin.version}</version>
{{/kotlinSupport}}
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<artifactId>{{kotlinStdlibArtifactId}}</artifactId>
{{^kotlinSupport}}
<version>${kotlin.version}</version>
{{/kotlinSupport}}
@@ -181,8 +181,8 @@
{{/groovy}}
{{#kotlin}}
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
{{^kotlinSupport}}
<version>${kotlin.version}</version>
{{/kotlinSupport}}
@@ -275,5 +275,4 @@
</pluginRepositories>
{{/isRelease}}
</project>

View File

@@ -219,6 +219,39 @@ public class ProjectGeneratorBuildTests extends AbstractProjectGeneratorTests {
"project/" + this.build + "/bom-ordering-" + this.assertFileName));
}
@Test
public void repositories() {
Dependency foo = Dependency.withId("foo", "org.acme", "foo");
foo.setRepository("foo-repository");
Dependency bar = Dependency.withId("bar", "org.acme", "bar");
bar.setRepository("bar-repository");
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults()
.addDependencyGroup("test", foo, bar)
.addRepository("foo-repository", "foo-repo", "https://example.com/foo",
false)
.addRepository("bar-repository", "bar-repo", "https://example.com/bar",
true)
.build();
applyMetadata(metadata);
ProjectRequest request = createProjectRequest("foo", "bar");
ProjectAssert project = generateProject(request);
project.sourceCodeAssert(this.fileName).equalsTo(new ClassPathResource(
"project/" + this.build + "/repositories-" + this.assertFileName));
}
@Test
public void repositoriesMilestone() {
Dependency foo = Dependency.withId("foo", "org.acme", "foo");
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults()
.addDependencyGroup("test", foo).build();
applyMetadata(metadata);
ProjectRequest request = createProjectRequest("foo");
request.setBootVersion("2.2.0.M1");
ProjectAssert project = generateProject(request);
project.sourceCodeAssert(this.fileName).equalsTo(new ClassPathResource("project/"
+ this.build + "/repositories-milestone-" + this.assertFileName));
}
@Override
public ProjectRequest createProjectRequest(String... styles) {
ProjectRequest request = super.createProjectRequest(styles);

View File

@@ -0,0 +1,33 @@
buildscript {
ext {
springBootVersion = '2.1.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://example.com/foo" }
maven { url "https://example.com/bar" }
}
dependencies {
implementation('org.acme:bar')
implementation('org.acme:foo')
testImplementation('org.springframework.boot:spring-boot-starter-test')
}

View File

@@ -0,0 +1,34 @@
buildscript {
ext {
springBootVersion = '2.2.0.M1'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
implementation('org.acme:foo')
testImplementation('org.springframework.boot:spring-boot-starter-test')
}

View File

@@ -64,5 +64,4 @@
</plugins>
</build>
</project>

View File

@@ -64,5 +64,4 @@
</plugins>
</build>
</project>

View File

@@ -69,5 +69,4 @@
</plugins>
</build>
</project>

View File

@@ -41,5 +41,4 @@
</plugins>
</build>
</project>

View File

@@ -41,5 +41,4 @@
</plugins>
</build>
</project>

View File

@@ -46,5 +46,4 @@
</plugins>
</build>
</project>

View File

@@ -27,12 +27,12 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
@@ -52,8 +52,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<configuration>
<args>
@@ -91,5 +91,4 @@
</plugins>
</build>
</project>

View File

@@ -27,11 +27,11 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
@@ -50,8 +50,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
@@ -71,5 +71,4 @@
</plugins>
</build>
</project>

View File

@@ -27,11 +27,11 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
@@ -55,8 +55,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
@@ -76,5 +76,4 @@
</plugins>
</build>
</project>

View File

@@ -67,5 +67,4 @@
</plugins>
</build>
</project>

View File

@@ -54,5 +54,4 @@
</plugins>
</build>
</project>

View File

@@ -50,5 +50,4 @@
</plugins>
</build>
</project>

View File

@@ -27,11 +27,11 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
<dependency>
@@ -50,8 +50,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
@@ -71,5 +71,4 @@
</plugins>
</build>
</project>

View File

@@ -0,0 +1,82 @@
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.M1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.acme</groupId>
<artifactId>foo</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

View File

@@ -0,0 +1,67 @@
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.acme</groupId>
<artifactId>bar</artifactId>
</dependency>
<dependency>
<groupId>org.acme</groupId>
<artifactId>foo</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>foo-repository</id>
<name>foo-repo</name>
<url>https://example.com/foo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>bar-repository</id>
<name>bar-repo</name>
<url>https://example.com/bar</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>

View File

@@ -43,5 +43,4 @@
</plugins>
</build>
</project>