Support for dependency description

This commit updates the configuration format and JSON metadata output
to support an additional description attribute.

The description attribute is meant to further describe the purpose of the
dependency. This is a minor update to the JSON format that is fully
backward compatible.

Fixes gh-40
This commit is contained in:
Stephane Nicoll
2014-10-24 14:06:45 +02:00
parent 09f91aa53b
commit 109f93424b
6 changed files with 159 additions and 4 deletions

View File

@@ -12,82 +12,109 @@ initializr:
content: content:
- name: Security - name: Security
id: security id: security
description: Support for spring-security
- name: AOP - name: AOP
id: aop id: aop
description: Support for aspect-oriented programming including spring-aop and AspectJ
- name: Data - name: Data
content: content:
- name: JDBC - name: JDBC
id: jdbc id: jdbc
description: Support for JDBC databases
- name: JPA - name: JPA
id: data-jpa id: data-jpa
description: Support for the Java Persistence API including spring-data-jpa, spring-orm and Hibernate
aliases: aliases:
- jpa - jpa
- name: MongoDB - name: MongoDB
id: data-mongodb id: data-mongodb
description: Support for the MongoDB NoSQL Database, including spring-data-mongodb
- name: Redis - name: Redis
id: redis id: redis
description: Support for the REDIS key-value data store, including spring-redis
- name: Gemfire - name: Gemfire
id: data-gemfire id: data-gemfire
description: Support for the GemFire distributed data store including spring-data-gemfire
- name: Solr - name: Solr
id: data-solr id: data-solr
description: Support for the Apache Solr search platform, including spring-data-solr
- name: Elasticsearch - name: Elasticsearch
id: data-elasticsearch id: data-elasticsearch
description: Support for the Elasticsearch search and analytics engine including spring-data-elasticsearch
- name: I/O - name: I/O
content: content:
- name: Batch - name: Batch
id: batch id: batch
description: Support for Spring Batch including HSQLDB database
- name: Integration - name: Integration
id: integration id: integration
description: Support for common spring-integration modules
- name: JMS - name: JMS
id: hornetq id: hornetq
description: Support for Java Message Service API via HornetQ
- name: AMQP - name: AMQP
id: amqp id: amqp
description: Support for the Advanced Message Queuing Protocol via spring-rabbit
- name: Web - name: Web
content: content:
- name: Web - name: Web
id: web id: web
description: Support for full-stack web development, including Tomcat and spring-webmvc
facets: facets:
- web - web
- name: Websocket - name: Websocket
id: websocket id: websocket
description: Support for websocket development with Tomcat
- name: WS - name: WS
id: ws id: ws
description: Support for Spring Web Services
- name: Rest Repositories - name: Rest Repositories
id: data-rest id: data-rest
description: Support for exposing Spring Data repositories over REST via spring-data-rest-webmvc
- name: Mobile - name: Mobile
id: mobile id: mobile
description: Support for spring-mobile
- name: Template Engines - name: Template Engines
content: content:
- name: Freemarker - name: Freemarker
id: freemarker id: freemarker
description: Support for the FreeMarker templating engine
facets: facets:
- web - web
- name: Velocity - name: Velocity
id: velocity id: velocity
description: Support for the Velocity templating engine
facets: facets:
- web - web
- name: Groovy Templates - name: Groovy Templates
id: groovy-templates id: groovy-templates
description: Support for the Groovy templating engine
facets: facets:
- web - web
- name: Thymeleaf - name: Thymeleaf
id: thymeleaf id: thymeleaf
description: Support for the Thymeleaf templating engine, including integration with Spring
facets: facets:
- web - web
- name: Social - name: Social
content: content:
- name: Facebook - name: Facebook
id: social-facebook id: social-facebook
description: Support for spring-social-facebook
- name: LinkedIn - name: LinkedIn
id: social-linkedin id: social-linkedin
description: Support for spring-social-linkedin
- name: Twitter - name: Twitter
id: social-twitter id: social-twitter
description: Support for spring-social-twitter
- name: Ops - name: Ops
content: content:
- name: Actuator - name: Actuator
id: actuator id: actuator
description: Production ready features to help you monitor and manage your application
- name: Remote Shell - name: Remote Shell
id: remote-shell id: remote-shell
description: Support for CRaSH
types: types:
- name: Maven POM - name: Maven POM
id: maven-build id: maven-build

View File

@@ -206,6 +206,8 @@ class InitializrMetadata {
@JsonIgnore @JsonIgnore
String version String version
String description
/** /**
* Specify if the dependency has its coordinates set, i.e. {@code groupId} * Specify if the dependency has its coordinates set, i.e. {@code groupId}
* and {@code artifactId}. * and {@code artifactId}.

View File

@@ -103,14 +103,14 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra
@Test // Test that the current output is exactly what we expect @Test // Test that the current output is exactly what we expect
void validateCurrentProjectMetadata() { void validateCurrentProjectMetadata() {
def json = restTemplate.getForObject(createUrl('/'), String.class) def json = restTemplate.getForObject(createUrl('/'), String.class)
def expected = readJson('1.0') def expected = readJson('1.0.1')
JSONAssert.assertEquals(expected, new JSONObject(json), JSONCompareMode.STRICT) JSONAssert.assertEquals(expected, new JSONObject(json), JSONCompareMode.STRICT)
} }
@Test // Test that the current code complies "at least" with 1.0 @Test // Test that the current code complies "at least" with 1.0.0
void validateProjectMetadata10() { void validateProjectMetadata100() {
def json = restTemplate.getForObject(createUrl('/'), String.class) def json = restTemplate.getForObject(createUrl('/'), String.class)
def expected = readJson('1.0') def expected = readJson('1.0.0')
JSONAssert.assertEquals(expected, new JSONObject(json), JSONCompareMode.LENIENT) JSONAssert.assertEquals(expected, new JSONObject(json), JSONCompareMode.LENIENT)
} }

View File

@@ -9,6 +9,7 @@ initializr:
content: content:
- name: Web - name: Web
id: web id: web
description: Web dependency description
facets: facets:
- web - web
- name: Security - name: Security

View File

@@ -0,0 +1,125 @@
{"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": "pom.xml",
"action": "/pom.xml",
"default": false
},
{
"name": "Maven Project",
"id": "starter.zip",
"action": "/starter.zip",
"default": true
},
{
"name": "Gradle Config",
"id": "build.gradle",
"action": "/build.gradle",
"default": false
},
{
"name": "Gradle Project",
"id": "gradle.zip",
"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": "starter.zip",
"packaging": "jar",
"javaVersion": "1.7",
"language": "java",
"bootVersion": "1.1.4.RELEASE"
}
}