Remove support for deprecated meta-data V1

Closes gh-74
This commit is contained in:
Stephane Nicoll
2015-02-12 10:12:29 +01:00
parent 0e5e825181
commit 1a213cdbc7
7 changed files with 1 additions and 435 deletions

View File

@@ -7,6 +7,7 @@ order.
=== Release 1.0.0 (In progress)
* https://github.com/spring-io/initializr/issues/74[#74]: remove support for meta-data V1.
* https://github.com/spring-io/initializr/issues/71[#71]: update project layout for Groovy-based projects.
* https://github.com/spring-io/initializr/issues/69[#69]: improve the structure of templated urls.
* https://github.com/spring-io/initializr/issues/70[#70]: explicit support for HTTPie (similar to curl).

View File

@@ -18,8 +18,6 @@ package io.spring.initializr
import javax.annotation.PostConstruct
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonInclude
import groovy.transform.ToString
import groovy.util.logging.Slf4j
@@ -59,10 +57,8 @@ class InitializrMetadata {
final Defaults defaults = new Defaults()
@JsonIgnore
final Env env = new Env()
@JsonIgnore
private final Map<String, Dependency> indexedDependencies = [:]
private final transient InitializrMetadataJsonMapper jsonMapper = new InitializrMetadataJsonMapper()
@@ -209,7 +205,6 @@ class InitializrMetadata {
return (elements.isEmpty() ? null : elements.get(0).id)
}
@JsonInclude(JsonInclude.Include.NON_NULL)
static class DependencyGroup {
String name
@@ -221,19 +216,14 @@ class InitializrMetadata {
@ToString(ignoreNulls = true, includePackage = false)
static class Dependency extends IdentifiableElement {
@JsonIgnore
List<String> aliases = []
@JsonIgnore
List<String> facets = []
@JsonIgnore
String groupId
@JsonIgnore
String artifactId
@JsonIgnore
String version
String description
@@ -276,7 +266,6 @@ class InitializrMetadata {
String description
@JsonIgnore
@Deprecated
String stsId
@@ -356,7 +345,6 @@ class InitializrMetadata {
static class DefaultIdentifiableElement extends IdentifiableElement {
@JsonIgnore
private boolean defaultValue
void setDefault(boolean defaultValue) {
@@ -368,7 +356,6 @@ class InitializrMetadata {
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
static class IdentifiableElement {
String name

View File

@@ -18,7 +18,6 @@ package io.spring.initializr.web
import groovy.util.logging.Slf4j
import io.spring.initializr.CommandLineHelpGenerator
import io.spring.initializr.InitializrMetadata
import io.spring.initializr.ProjectGenerator
import io.spring.initializr.ProjectRequest
@@ -32,7 +31,6 @@ import org.springframework.web.bind.annotation.ModelAttribute
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody
import org.springframework.web.context.request.WebRequest
import org.springframework.web.servlet.support.ServletUriComponentsBuilder
/**
@@ -63,13 +61,6 @@ class MainController extends AbstractInitializrController {
request
}
@RequestMapping(value = "/", headers = "user-agent=SpringBootCli/1.2.0.RC1")
@ResponseBody
@Deprecated
InitializrMetadata oldMetadata() {
metadataProvider.get()
}
@RequestMapping(value = "/", produces = ["text/plain"])
ResponseEntity<String> serviceCapabilities(
@RequestHeader(value = HttpHeaders.USER_AGENT, required = false) String userAgent) {

View File

@@ -25,9 +25,6 @@ import org.skyscreamer.jsonassert.JSONAssert
import org.skyscreamer.jsonassert.JSONCompareMode
import org.springframework.core.io.ClassPathResource
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
@@ -248,27 +245,6 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra
not(containsString("curl"))))
}
@Test // Test that the current code complies exactly with 1.1.0
void validateProjectMetadata110() {
JSONObject json = getMetadataJson("SpringBootCli/1.2.0.RC1", null)
def expected = readJson('1.0.1')
JSONAssert.assertEquals(expected, json, JSONCompareMode.LENIENT)
}
@Test // Test that the current code complies "at least" with 1.0.1
void validateProjectMetadata101() {
JSONObject json = getMetadataJson("SpringBootCli/1.2.0.RC1", null)
def expected = readJson('1.0.1')
JSONAssert.assertEquals(expected, json, JSONCompareMode.LENIENT)
}
@Test // Test that the current code complies "at least" with 1.0.0
void validateProjectMetadata100() {
JSONObject json = getMetadataJson("SpringBootCli/1.2.0.RC1", null)
def expected = readJson('1.0.0')
JSONAssert.assertEquals(expected, json, JSONCompareMode.LENIENT)
}
@Test
void metricsAvailableByDefault() {
downloadZip('/starter.zip?packaging=jar&javaVersion=1.8&style=web&style=jpa')

View File

@@ -1,124 +0,0 @@
{"dependencies": [
{
"name": "Core",
"content": [
{
"name": "Web",
"id": "web"
},
{
"name": "Security",
"id": "security"
},
{
"name": "Data JPA",
"id": "data-jpa"
}
]
},
{
"name": "Other",
"content": [
{
"name": "Foo",
"id": "org.acme:foo"
},
{
"name": "Bar",
"id": "org.acme:bar"
}
]
}
], "types": [
{
"name": "Maven POM",
"id": "maven-build",
"action": "/pom.xml",
"default": false
},
{
"name": "Maven Project",
"id": "maven-project",
"action": "/starter.zip",
"default": true
},
{
"name": "Gradle Config",
"id": "gradle-build",
"action": "/build.gradle",
"default": false
},
{
"name": "Gradle Project",
"id": "gradle-project",
"action": "/starter.zip",
"default": false
}
], "packagings": [
{
"name": "Jar",
"id": "jar",
"default": true
},
{
"name": "War",
"id": "war",
"default": false
}
], "javaVersions": [
{
"name": "1.6",
"id": "1.6",
"default": false
},
{
"name": "1.7",
"id": "1.7",
"default": true
},
{
"name": "1.8",
"id": "1.8",
"default": false
}
], "languages": [
{
"name": "Groovy",
"id": "groovy",
"default": false
},
{
"name": "Java",
"id": "java",
"default": true
}
], "bootVersions": [
{
"name": "Latest SNAPSHOT",
"id": "1.2.0.BUILD-SNAPSHOT",
"default": false
},
{
"name": "1.1.4",
"id": "1.1.4.RELEASE",
"default": true
},
{
"name": "1.0.2",
"id": "1.0.2.RELEASE",
"default": false
}
], "defaults": {
"groupId": "org.test",
"artifactId": "demo",
"version": "0.0.1-SNAPSHOT",
"name": "demo",
"description": "Demo project for Spring Boot",
"packageName": "demo",
"type": "maven-project",
"packaging": "jar",
"javaVersion": "1.7",
"language": "java",
"bootVersion": "1.1.4.RELEASE"
}
}

View File

@@ -1,125 +0,0 @@
{"dependencies": [
{
"name": "Core",
"content": [
{
"name": "Web",
"id": "web",
"description": "Web dependency description"
},
{
"name": "Security",
"id": "security"
},
{
"name": "Data JPA",
"id": "data-jpa"
}
]
},
{
"name": "Other",
"content": [
{
"name": "Foo",
"id": "org.acme:foo"
},
{
"name": "Bar",
"id": "org.acme:bar"
}
]
}
], "types": [
{
"name": "Maven POM",
"id": "maven-build",
"action": "/pom.xml",
"default": false
},
{
"name": "Maven Project",
"id": "maven-project",
"action": "/starter.zip",
"default": true
},
{
"name": "Gradle Config",
"id": "gradle-build",
"action": "/build.gradle",
"default": false
},
{
"name": "Gradle Project",
"id": "gradle-project",
"action": "/starter.zip",
"default": false
}
], "packagings": [
{
"name": "Jar",
"id": "jar",
"default": true
},
{
"name": "War",
"id": "war",
"default": false
}
], "javaVersions": [
{
"name": "1.6",
"id": "1.6",
"default": false
},
{
"name": "1.7",
"id": "1.7",
"default": true
},
{
"name": "1.8",
"id": "1.8",
"default": false
}
], "languages": [
{
"name": "Groovy",
"id": "groovy",
"default": false
},
{
"name": "Java",
"id": "java",
"default": true
}
], "bootVersions": [
{
"name": "Latest SNAPSHOT",
"id": "1.2.0.BUILD-SNAPSHOT",
"default": false
},
{
"name": "1.1.4",
"id": "1.1.4.RELEASE",
"default": true
},
{
"name": "1.0.2",
"id": "1.0.2.RELEASE",
"default": false
}
], "defaults": {
"groupId": "org.test",
"artifactId": "demo",
"version": "0.0.1-SNAPSHOT",
"name": "demo",
"description": "Demo project for Spring Boot",
"packageName": "demo",
"type": "maven-project",
"packaging": "jar",
"javaVersion": "1.7",
"language": "java",
"bootVersion": "1.1.4.RELEASE"
}
}

View File

@@ -1,140 +0,0 @@
{"dependencies": [
{
"name": "Core",
"content": [
{
"name": "Web",
"id": "web",
"description": "Web dependency description"
},
{
"name": "Security",
"id": "security"
},
{
"name": "Data JPA",
"id": "data-jpa"
}
]
},
{
"name": "Other",
"content": [
{
"name": "Foo",
"id": "org.acme:foo"
},
{
"name": "Bar",
"id": "org.acme:bar"
}
]
}
], "types": [
{
"name": "Maven POM",
"id": "maven-build",
"action": "/pom.xml",
"tags": {
"build": "maven",
"format": "build"
},
"default": false
},
{
"name": "Maven Project",
"id": "maven-project",
"action": "/starter.zip",
"tags": {
"build": "maven",
"format": "project"
},
"default": true
},
{
"name": "Gradle Config",
"id": "gradle-build",
"action": "/build.gradle",
"tags": {
"build": "gradle",
"format": "build"
},
"default": false
},
{
"name": "Gradle Project",
"id": "gradle-project",
"action": "/starter.zip",
"tags": {
"build": "gradle",
"format": "project"
},
"default": false
}
], "packagings": [
{
"name": "Jar",
"id": "jar",
"default": true
},
{
"name": "War",
"id": "war",
"default": false
}
], "javaVersions": [
{
"name": "1.6",
"id": "1.6",
"default": false
},
{
"name": "1.7",
"id": "1.7",
"default": true
},
{
"name": "1.8",
"id": "1.8",
"default": false
}
], "languages": [
{
"name": "Groovy",
"id": "groovy",
"default": false
},
{
"name": "Java",
"id": "java",
"default": true
}
], "bootVersions": [
{
"name": "Latest SNAPSHOT",
"id": "1.2.0.BUILD-SNAPSHOT",
"default": false
},
{
"name": "1.1.4",
"id": "1.1.4.RELEASE",
"default": true
},
{
"name": "1.0.2",
"id": "1.0.2.RELEASE",
"default": false
}
], "defaults": {
"groupId": "org.test",
"artifactId": "demo",
"version": "0.0.1-SNAPSHOT",
"name": "demo",
"description": "Demo project for Spring Boot",
"packageName": "demo",
"type": "maven-project",
"packaging": "jar",
"javaVersion": "1.7",
"language": "java",
"bootVersion": "1.1.4.RELEASE"
}}