mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 01:58:16 +08:00
Harmonize metadata term
This commit is contained in:
@@ -19,7 +19,7 @@ package io.spring.initializr.metadata
|
||||
import io.spring.initializr.util.Version
|
||||
|
||||
/**
|
||||
* Dependency meta-data for a given spring boot {@link Version}.
|
||||
* Dependency metadata for a given spring boot {@link Version}.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.0
|
||||
|
@@ -117,7 +117,7 @@ class InitializrConfiguration {
|
||||
String artifactRepository = 'https://repo.spring.io/release/'
|
||||
|
||||
/**
|
||||
* The meta-data url of the Spring Boot project.
|
||||
* The metadata url of the Spring Boot project.
|
||||
*/
|
||||
String springBootMetadataUrl = 'https://spring.io/project_metadata/spring-boot'
|
||||
|
||||
|
@@ -84,7 +84,7 @@ class InitializrMetadata {
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the meta-data.
|
||||
* Validate the metadata.
|
||||
*/
|
||||
void validate() {
|
||||
this.configuration.validate()
|
||||
|
@@ -25,7 +25,7 @@ import org.springframework.core.io.Resource
|
||||
import org.springframework.util.StreamUtils
|
||||
|
||||
/**
|
||||
* Builder for {@link InitializrMetadata}. Allows to read meta-data from any arbitrary resource,
|
||||
* Builder for {@link InitializrMetadata}. Allows to read metadata from any arbitrary resource,
|
||||
* including remote URLs.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
@@ -81,7 +81,7 @@ class InitializrMetadataBuilder {
|
||||
|
||||
/**
|
||||
* Add a {@link InitializrMetadata} to be merged with other content.
|
||||
* @param resource a resource to a json document describing the meta-data to include
|
||||
* @param resource a resource to a json document describing the metadata to include
|
||||
*/
|
||||
InitializrMetadataBuilder withInitializrMetadata(Resource resource) {
|
||||
withCustomizer(new ResourceInitializrMetadataCustomizer(resource))
|
||||
@@ -174,7 +174,7 @@ class InitializrMetadataBuilder {
|
||||
|
||||
@Override
|
||||
void customize(InitializrMetadata metadata) {
|
||||
log.info("Loading initializr meta-data from $resource")
|
||||
log.info("Loading initializr metadata from $resource")
|
||||
def content = StreamUtils.copyToString(resource.getInputStream(), UTF_8)
|
||||
ObjectMapper objectMapper = new ObjectMapper()
|
||||
def anotherMetadata = objectMapper.readValue(content, InitializrMetadata)
|
||||
|
@@ -66,37 +66,37 @@ class InitializrProperties extends InitializrConfiguration {
|
||||
final List<DefaultMetadataElement> bootVersions = []
|
||||
|
||||
/**
|
||||
* GroupId meta-data.
|
||||
* GroupId metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement groupId = new SimpleElement(value: 'com.example')
|
||||
|
||||
/**
|
||||
* ArtifactId meta-data.
|
||||
* ArtifactId metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement artifactId = new SimpleElement()
|
||||
|
||||
/**
|
||||
* Version meta-data.
|
||||
* Version metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement version = new SimpleElement(value: '0.0.1-SNAPSHOT')
|
||||
|
||||
/**
|
||||
* Name meta-data.
|
||||
* Name metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement name = new SimpleElement(value: 'demo')
|
||||
|
||||
/**
|
||||
* Description meta-data.
|
||||
* Description metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement description = new SimpleElement(value: 'Demo project for Spring Boot')
|
||||
|
||||
/**
|
||||
* Package name meta-data.
|
||||
* Package name metadata.
|
||||
*/
|
||||
@JsonIgnore
|
||||
final SimpleElement packageName = new SimpleElement()
|
||||
|
@@ -20,7 +20,7 @@ import groovy.transform.AutoClone
|
||||
import groovy.transform.AutoCloneStyle
|
||||
|
||||
/**
|
||||
* A basic meta-data element
|
||||
* A basic metadata element
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.0
|
||||
|
@@ -227,7 +227,7 @@
|
||||
{
|
||||
"name": "initializr.env.spring-boot-metadata-url",
|
||||
"type": "java.lang.String",
|
||||
"description": "The meta-data url of the Spring Boot project.",
|
||||
"description": "The metadata url of the Spring Boot project.",
|
||||
"sourceType": "io.spring.initializr.metadata.InitializrConfiguration$Env",
|
||||
"defaultValue": "https://spring.io/project_metadata/spring-boot"
|
||||
},
|
||||
|
@@ -77,10 +77,10 @@ class InitializrMetadataBuilderTests {
|
||||
assertEquals 2, metadata.packagings.content.size()
|
||||
assertEquals 1, metadata.javaVersions.content.size()
|
||||
assertEquals 3, metadata.languages.content.size()
|
||||
assertEquals 'meta-data-merge', metadata.name.content
|
||||
assertEquals 'Demo project for meta-data merge', metadata.description.content
|
||||
assertEquals 'metadata-merge', metadata.name.content
|
||||
assertEquals 'Demo project for metadata merge', metadata.description.content
|
||||
assertEquals 'org.acme', metadata.groupId.content
|
||||
assertEquals 'meta-data', metadata.artifactId.content
|
||||
assertEquals 'metadata', metadata.artifactId.content
|
||||
assertEquals '1.0.0-SNAPSHOT', metadata.version.content
|
||||
assertEquals 'org.acme.demo', metadata.packageName.content
|
||||
}
|
||||
|
@@ -113,13 +113,13 @@
|
||||
"id": "name",
|
||||
"type": "TEXT",
|
||||
"description": null,
|
||||
"content": "meta-data-merge"
|
||||
"content": "metadata-merge"
|
||||
},
|
||||
"description": {
|
||||
"id": "description",
|
||||
"type": "TEXT",
|
||||
"description": null,
|
||||
"content": "Demo project for meta-data merge"
|
||||
"content": "Demo project for metadata merge"
|
||||
},
|
||||
"groupId": {
|
||||
"id": "groupId",
|
||||
@@ -131,7 +131,7 @@
|
||||
"id": "artifactId",
|
||||
"type": "TEXT",
|
||||
"description": null,
|
||||
"content": "meta-data"
|
||||
"content": "metadata"
|
||||
},
|
||||
"version": {
|
||||
"id": "version",
|
||||
|
Reference in New Issue
Block a user