mirror of
https://gitee.com/dcren/initializr.git
synced 2025-04-05 17:38:06 +08:00
Harmonize metadata term
This commit is contained in:
parent
ad4ed895d9
commit
0a4f631b3a
20
README.adoc
20
README.adoc
@ -10,7 +10,7 @@ link:https://start.spring.io[]. It provides a simple web UI to configure the pro
|
||||
to generate and endpoints that you can use via plain HTTP.
|
||||
|
||||
Spring Initializr also exposes an endpoint that serves its
|
||||
{wiki}/Metadata-format[meta-data] in a well-known format to allow third-party
|
||||
{wiki}/Metadata-format[metadata] in a well-known format to allow third-party
|
||||
clients to provide the necessary assistance.
|
||||
|
||||
Finally, Initializr offers a configuration structure to define all the aspects related
|
||||
@ -74,10 +74,10 @@ an invalid character for a java identifier, `Application` is used as fallback.
|
||||
** The `artifactId` attribute not only defines the identifier of the project in the build but
|
||||
also the name of the generated archive.
|
||||
* `dependencies` (or `style`): the identifiers of the dependencies to add to the project. Such
|
||||
identifiers are defined through configuration and are exposed in the <<meta-data,meta-data>>.
|
||||
identifiers are defined through configuration and are exposed in the <<metadata,metadata>>.
|
||||
* `type`: the _kind_ of project to generate (e.g. `maven-project`). Again, each service
|
||||
exposes an arbitrary number of supported types and these are available in the
|
||||
<<meta-data,meta-data>>.
|
||||
<<metadata,metadata>>.
|
||||
* `javaVersion`: the language level (e.g. `1.8`).
|
||||
* `bootVersion`: the Spring Boot version to use (e.g. `1.2.0.RELEASE`).
|
||||
* `language`: the programming language to use (e.g. `java`).
|
||||
@ -118,11 +118,11 @@ The following hashbang parameters are supported: `type`, `groupId`, `artifactId`
|
||||
`description`, `packageName`, `packaging`, `javaVersion` and `language`. Review the section
|
||||
above for a description of each of them.
|
||||
|
||||
[[meta-data]]
|
||||
== Service meta-data
|
||||
[[metadata]]
|
||||
== Service metadata
|
||||
|
||||
The service meta-data is used by the web UI and is exposed to ease the creation of
|
||||
third-party clients. You can grab the meta-data by _curling_ the root
|
||||
The service metadata is used by the web UI and is exposed to ease the creation of
|
||||
third-party clients. You can grab the metadata by _curling_ the root
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
@ -132,15 +132,15 @@ $ curl -H 'Accept: application/json' https://start.spring.io
|
||||
NOTE: As stated above, if you use `curl` without an accept header, you'll retrieve a human
|
||||
readable text version of the metadata. `HTTPie` is also supported.
|
||||
|
||||
The meta-data basically lists the _capabilities_ of the service, that is the available
|
||||
The metadata basically lists the _capabilities_ of the service, that is the available
|
||||
options for all request parameters (`dependencies`, `type`, `bootVersion`, etc.) The web
|
||||
UI uses that information to initialize the select options and the tree of available
|
||||
dependencies.
|
||||
|
||||
The meta-data also lists the default values for simple _text_ parameter (i.e. the default
|
||||
The metadata also lists the default values for simple _text_ parameter (i.e. the default
|
||||
`name` for the project).
|
||||
|
||||
NOTE: More details about the structure of the meta-data are {wiki}/Metadata-format[available
|
||||
NOTE: More details about the structure of the metadata are {wiki}/Metadata-format[available
|
||||
on the wiki].
|
||||
|
||||
== Running your own instance
|
||||
|
@ -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",
|
||||
|
@ -27,7 +27,7 @@ import io.spring.initializr.metadata.DependencyMetadata
|
||||
interface DependencyMetadataJsonMapper {
|
||||
|
||||
/**
|
||||
* Write a json representation of the specified meta-data.
|
||||
* Write a json representation of the specified metadata.
|
||||
*/
|
||||
String write(DependencyMetadata metadata);
|
||||
|
||||
|
@ -23,7 +23,7 @@ import io.spring.initializr.metadata.DependencyMetadata
|
||||
import io.spring.initializr.metadata.Repository
|
||||
|
||||
/**
|
||||
* A {@link DependencyMetadataJsonMapper} handling the meta-data format for v2.1.
|
||||
* A {@link DependencyMetadataJsonMapper} handling the metadata format for v2.1.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.0
|
||||
|
@ -27,7 +27,7 @@ import io.spring.initializr.metadata.InitializrMetadata
|
||||
interface InitializrMetadataJsonMapper {
|
||||
|
||||
/**
|
||||
* Write a json representation of the specified meta-data.
|
||||
* Write a json representation of the specified metadata.
|
||||
*/
|
||||
String write(InitializrMetadata metadata, String appUrl);
|
||||
|
||||
|
@ -21,7 +21,7 @@ import org.springframework.hateoas.TemplateVariables
|
||||
import org.springframework.hateoas.UriTemplate
|
||||
|
||||
/**
|
||||
* A {@link InitializrMetadataJsonMapper} handling the meta-data format for v2.1
|
||||
* A {@link InitializrMetadataJsonMapper} handling the metadata format for v2.1
|
||||
* <p>
|
||||
* Version 2.1 brings the 'versionRange' attribute for a dependency to restrict
|
||||
* the Spring Boot versions that can be used against it. That version also adds
|
||||
|
@ -25,7 +25,7 @@ import org.springframework.hateoas.TemplateVariables
|
||||
import org.springframework.hateoas.UriTemplate
|
||||
|
||||
/**
|
||||
* A {@link InitializrMetadataJsonMapper} handling the meta-data format for v2.
|
||||
* A {@link InitializrMetadataJsonMapper} handling the metadata format for v2.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.0
|
||||
|
@ -19,7 +19,7 @@ package io.spring.initializr.web.mapper
|
||||
import org.springframework.http.MediaType
|
||||
|
||||
/**
|
||||
* Define the supported meta-data version.
|
||||
* Define the supported metadata version.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.0
|
||||
@ -34,7 +34,7 @@ enum InitializrMetadataVersion {
|
||||
/**
|
||||
* Add 'versionRange' attribute to any dependency to specify which
|
||||
* Spring Boot versions are compatible with it. Also provide a
|
||||
* separate 'dependencies' endpoint to query dependencies meta-data.
|
||||
* separate 'dependencies' endpoint to query dependencies metadata.
|
||||
*/
|
||||
V2_1('application/vnd.initializr.v2.1+json')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user