diff --git a/vscode-extensions/vscode-boot-java/pom.xml b/vscode-extensions/vscode-boot-java/pom.xml
index 7214d4cb3..de3f34aba 100644
--- a/vscode-extensions/vscode-boot-java/pom.xml
+++ b/vscode-extensions/vscode-boot-java/pom.xml
@@ -4,14 +4,14 @@
4.0.0vscode-boot-javajar
-
+
org.springframework.ide.vscodecommons-parent0.0.1-SNAPSHOT../commons/pom.xml
-
+
@@ -22,12 +22,8 @@
true
-
- project-repo
- file://${project.basedir}/repo
-
-
+
distribution-repository
@@ -35,13 +31,8 @@
file://${basedir}/dist
-
+
-
- org.springframework.ide.eclipse
- org.json
- 1.0
- org.springframework.ide.vscodecommons-maven
@@ -57,7 +48,7 @@
commons-language-server${project.version}
-
+
org.eclipse.jdt
@@ -71,6 +62,12 @@
2.4
+
+ org.springframework.boot
+ spring-boot-configuration-metadata
+ 1.5.1.RELEASE
+
+
org.springframework.ide.vscode
@@ -78,7 +75,7 @@
${project.version}test
-
+
@@ -116,6 +113,6 @@
-
+
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataGroup.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataGroup.java
deleted file mode 100644
index ea6428e85..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataGroup.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2012-2015 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Gather a collection of {@link ConfigurationMetadataProperty properties} that are
- * sharing a {@link #getId() common prefix}. Provide access to all the
- * {@link ConfigurationMetadataSource sources} that have contributed properties to the
- * group.
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-@SuppressWarnings("serial")
-public class ConfigurationMetadataGroup implements Serializable {
-
- private final String id;
-
- private final Map sources = new HashMap();
-
- private final Map properties = new HashMap();
-
- public ConfigurationMetadataGroup(String id) {
- this.id = id;
- }
-
- /**
- * Return the id of the group, used as a common prefix for all properties associated
- * to it.
- * @return the id of the group
- */
- public String getId() {
- return this.id;
- }
-
- /**
- * Return the {@link ConfigurationMetadataSource sources} defining the properties of
- * this group.
- * @return the sources of the group
- */
- public Map getSources() {
- return this.sources;
- }
-
- /**
- * Return the {@link ConfigurationMetadataProperty properties} defined in this group.
- *
- * A property may appear more than once for a given source, potentially with
- * conflicting type or documentation. This is a "merged" view of the properties of
- * this group.
- * @return the properties of the group
- * @see ConfigurationMetadataSource#getProperties()
- */
- public Map getProperties() {
- return this.properties;
- }
-
-}
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataHint.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataHint.java
deleted file mode 100644
index 9f5e1f204..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataHint.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2012-2016 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A raw view of a hint used for parsing only.
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-class ConfigurationMetadataHint {
-
- private static final String KEY_SUFFIX = ".keys";
-
- private static final String VALUE_SUFFIX = ".values";
-
- private String id;
-
- private final List valueHints = new ArrayList();
-
- private final List valueProviders = new ArrayList();
-
- public boolean isMapKeyHints() {
- return (this.id != null && this.id.endsWith(KEY_SUFFIX));
- }
-
- public boolean isMapValueHints() {
- return (this.id != null && this.id.endsWith(VALUE_SUFFIX));
- }
-
- public String resolveId() {
- if (isMapKeyHints()) {
- return this.id.substring(0, this.id.length() - KEY_SUFFIX.length());
- }
- if (isMapValueHints()) {
- return this.id.substring(0, this.id.length() - VALUE_SUFFIX.length());
- }
- return this.id;
- }
-
- public String getId() {
- return this.id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public List getValueHints() {
- return this.valueHints;
- }
-
- public List getValueProviders() {
- return this.valueProviders;
- }
-
-}
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataItem.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataItem.java
deleted file mode 100644
index 4001c4da1..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataItem.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2012-2016 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-/**
- * An extension of {@link ConfigurationMetadataProperty} that provides a reference to its
- * source.
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-class ConfigurationMetadataItem extends ConfigurationMetadataProperty {
-
- private String sourceType;
-
- private String sourceMethod;
-
- /**
- * The class name of the source that contributed this property. For example, if the
- * property was from a class annotated with {@code @ConfigurationProperties} this
- * attribute would contain the fully qualified name of that class.
- * @return the source type
- */
- public String getSourceType() {
- return this.sourceType;
- }
-
- public void setSourceType(String sourceType) {
- this.sourceType = sourceType;
- }
-
- /**
- * The full name of the method (including parenthesis and argument types) that
- * contributed this property. For example, the name of a getter in a
- * {@code @ConfigurationProperties} annotated class.
- * @return the source method
- */
- public String getSourceMethod() {
- return this.sourceMethod;
- }
-
- public void setSourceMethod(String sourceMethod) {
- this.sourceMethod = sourceMethod;
- }
-
-}
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataProperty.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataProperty.java
deleted file mode 100644
index 997746490..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataProperty.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2012-2016 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * Define a configuration property. Each property is fully identified by its
- * {@link #getId() id} which is composed of a namespace prefix (the
- * {@link ConfigurationMetadataGroup#getId() group id}), if any and the {@link #getName()
- * name} of the property.
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-@SuppressWarnings("serial")
-public class ConfigurationMetadataProperty implements Serializable {
-
- private String id;
-
- private String name;
-
- private String type;
-
- private String description;
-
- private String shortDescription;
-
- private Object defaultValue;
-
- private final Hints hints = new Hints();
-
- private Deprecation deprecation;
-
- /**
- * The full identifier of the property, in lowercase dashed form (e.g.
- * my.group.simple-property)
- * @return the property id
- */
- public String getId() {
- return this.id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * The name of the property, in lowercase dashed form (e.g. simple-property). If this
- * item does not belong to any group, the id is returned.
- * @return the property name
- */
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * The class name of the data type of the property. For example,
- * {@code java.lang.String}.
- *
- * For consistency, the type of a primitive is specified using its wrapper
- * counterpart, i.e. {@code boolean} becomes {@code java.lang.Boolean}. If the type
- * holds generic information, these are provided as well, i.e. a {@code HashMap} of
- * String to Integer would be defined as {@code java.util.HashMap
- * }.
- *
- * Note that this class may be a complex type that gets converted from a String as
- * values are bound.
- * @return the property type
- */
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * A description of the property, if any. Can be multi-lines.
- * @return the property description
- * @see #getShortDescription()
- */
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * A single-line, single-sentence description of this property, if any.
- * @return the property short description
- * @see #getDescription()
- */
- public String getShortDescription() {
- return this.shortDescription;
- }
-
- public void setShortDescription(String shortDescription) {
- this.shortDescription = shortDescription;
- }
-
- /**
- * The default value, if any.
- * @return the default value
- */
- public Object getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(Object defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * Return the hints of this item.
- * @return the hints
- */
- public Hints getHints() {
- return this.hints;
- }
-
- /**
- * The list of well-defined values, if any. If no extra {@link ValueProvider provider}
- * is specified, these values are to be considered a closed-set of the available
- * values for this item.
- * @return the value hints
- * @see #getHints()
- */
- @Deprecated
- public List getValueHints() {
- return this.hints.getValueHints();
- }
-
- /**
- * The value providers that are applicable to this item. Only one
- * {@link ValueProvider} is enabled for an item: the first in the list that is
- * supported should be used.
- * @return the value providers
- * @see #getHints()
- */
- @Deprecated
- public List getValueProviders() {
- return this.hints.getValueProviders();
- }
-
- /**
- * The {@link Deprecation} for this property, if any.
- * @return the deprecation
- * @see #isDeprecated()
- */
- public Deprecation getDeprecation() {
- return this.deprecation;
- }
-
- public void setDeprecation(Deprecation deprecation) {
- this.deprecation = deprecation;
- }
-
- /**
- * Specify if the property is deprecated.
- * @return if the property is deprecated
- * @see #getDeprecation()
- */
- public boolean isDeprecated() {
- return this.deprecation != null;
- }
-
-}
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepository.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepository.java
deleted file mode 100644
index 95122ac2a..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepository.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2012-2015 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-import java.util.Map;
-
-/**
- * A repository of configuration metadata.
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-public interface ConfigurationMetadataRepository {
-
- /**
- * Defines the name of the "root" group, that is the group that gathers all the
- * properties that aren't attached to a specific group.
- */
- String ROOT_GROUP = "_ROOT_GROUP_";
-
- /**
- * Return the groups, indexed by id.
- * @return all configuration meta-data groups
- */
- Map getAllGroups();
-
- /**
- * Return the properties, indexed by id.
- * @return all configuration meta-data properties
- */
- Map getAllProperties();
-
-}
diff --git a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilder.java b/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilder.java
deleted file mode 100644
index b7d096fd8..000000000
--- a/vscode-extensions/vscode-boot-java/src/main/java/org/springframework/boot/configurationmetadata/ConfigurationMetadataRepositoryJsonBuilder.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright 2012-2016 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.configurationmetadata;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.springframework.ide.eclipse.org.json.JSONException;
-
-/**
- * Load a {@link ConfigurationMetadataRepository} from the content of arbitrary
- * resource(s).
- *
- * @author Stephane Nicoll
- * @since 1.3.0
- */
-public final class ConfigurationMetadataRepositoryJsonBuilder {
-
- /**
- * UTF-8 Charset.
- */
- public static final Charset UTF_8 = Charset.forName("UTF-8");
-
- private Charset defaultCharset = UTF_8;
-
- private final JsonReader reader = new JsonReader();
-
- private final List rawDatas = new ArrayList<>();
-
- private ConfigurationMetadataRepositoryJsonBuilder(Charset defaultCharset) {
- this.defaultCharset = defaultCharset;
- }
-
- /**
- * Add the content of a {@link ConfigurationMetadataRepository} defined by the
- * specified {@link InputStream} json document using the default charset. If this
- * metadata repository holds items that were loaded previously, these are ignored.
- *
- * Leaves the stream open when done.
- * @param origin optional information object to help identify where the inputstream came from
- * @param inputStream the source input stream
- * @return this builder
- * @throws IOException in case of I/O errors
- */
- public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(
- Object origin, InputStream inputStream) throws IOException {
- return withJsonResource(origin, inputStream, this.defaultCharset);
- }
-
- /**
- * Add the content of a {@link ConfigurationMetadataRepository} defined by the
- * specified {@link InputStream} json document using the specified {@link Charset}. If
- * this metadata repository holds items that were loaded previously, these are
- * ignored.
- *
- * Leaves the stream open when done.
- * @param origin optional information object to help identify where the inputstream came from
- * @param inputStream the source input stream
- * @param charset the charset of the input
- * @return this builder
- * @throws IOException in case of I/O errors
- */
- public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(
- Object origin, InputStream inputStream, Charset charset) throws IOException {
- if (inputStream == null) {
- throw new IllegalArgumentException("InputStream must not be null.");
- }
- this.rawDatas.add(parseRaw(origin, inputStream, charset));
- return this;
- }
-
- /**
- * Build a {@link ConfigurationMetadataRepository} with the current state of this
- * builder.
- * @return this builder
- */
- public ConfigurationMetadataRepository build() {
- SimpleConfigurationMetadataRepository result = new SimpleConfigurationMetadataRepository();
- result.include(create(rawDatas));
- return result;
- }
-
- private RawConfigurationMetadata parseRaw(Object origin, InputStream in, Charset charset)
- throws IOException {
- try {
- return this.reader.read(origin, in, charset);
- }
- catch (IOException ex) {
- throw new IllegalArgumentException(
- "Failed to read configuration " + "metadata", ex);
- }
- catch (JSONException ex) {
- throw new IllegalArgumentException(
- "Invalid configuration " + "metadata document", ex);
- }
- }
-
- private SimpleConfigurationMetadataRepository create(
- Iterable metadatas) {
- SimpleConfigurationMetadataRepository repository = new SimpleConfigurationMetadataRepository();
-
- for (RawConfigurationMetadata metadata : metadatas) {
- repository.add(metadata.getSources());
- }
- for (RawConfigurationMetadata metadata : metadatas) {
- for (ConfigurationMetadataItem item : metadata.getItems()) {
- ConfigurationMetadataSource source = getSource(metadata, item);
- repository.add(item, source);
- }
- }
- for (RawConfigurationMetadata metadata : metadatas) {
- Map allProperties = repository
- .getAllProperties();
- for (ConfigurationMetadataHint hint : metadata.getHints()) {
- ConfigurationMetadataProperty property = allProperties.get(hint.getId());
- if (property != null) {
- addValueHints(property, hint);
- }
- else {
- String id = hint.resolveId();
- property = allProperties.get(id);
- if (property != null) {
- if (hint.isMapKeyHints()) {
- addMapHints(property, hint);
- }
- else {
- addValueHints(property, hint);
- }
- }
- }
- }
- }
- return repository;
- }
-
- private void addValueHints(ConfigurationMetadataProperty property,
- ConfigurationMetadataHint hint) {
- addAll(property.getHints().getValueHints(), hint.getValueHints());
- property.getHints().getValueProviders().addAll(hint.getValueProviders());
- }
-
- private void addMapHints(ConfigurationMetadataProperty property,
- ConfigurationMetadataHint hint) {
- addAll(property.getHints().getKeyHints(), hint.getValueHints());
- property.getHints().getKeyProviders().addAll(hint.getValueProviders());
- }
-
- /**
- * Add a bunch of hints to a list, but guard against duplicates.
- */
- private void addAll(List existing, List toAdd) {
- if (existing.isEmpty()) {
- existing.addAll(toAdd);
- } else if (toAdd.isEmpty()) {
- //nothing to add
- } else {
- Set