Tabnine Logo
io.spring.initializr.metadata
Code IndexAdd Tabnine to your IDE (free)

How to use io.spring.initializr.metadata

Best Java code snippets using io.spring.initializr.metadata (Showing top 20 results out of 315)

origin: spring-io/initializr

private Dependency determineWebDependency(InitializrMetadata metadata) {
  Dependency web = metadata.getDependencies().get("web");
  if (web != null) {
    return web;
  }
  return Dependency.withId("web").asSpringBootStarter("web");
}
origin: spring-io/initializr

public boolean isForceSsl() {
  if (this.forceSsl == null) {
    this.forceSsl = this.metadataProvider.get().getConfiguration().getEnv()
        .isForceSsl();
  }
  return this.forceSsl;
}
origin: spring-io/initializr

/**
 * Create an URL suitable to download Spring Boot cli for the specified version and
 * extension.
 * @param extension the required extension
 * @return the download URL
 */
public String createCliDistributionURl(String extension) {
  String bootVersion = defaultId(this.bootVersions);
  return this.configuration.getEnv().getArtifactRepository()
      + "org/springframework/boot/spring-boot-cli/" + bootVersion
      + "/spring-boot-cli-" + bootVersion + "-bin." + extension;
}
origin: spring-io/initializr

@Override
public void customize(InitializrMetadata metadata) {
  metadata.getDependencies().merge(this.properties.getDependencies());
  metadata.getTypes().merge(this.properties.getTypes());
  metadata.getBootVersions().merge(this.properties.getBootVersions());
  metadata.getPackagings().merge(this.properties.getPackagings());
  metadata.getJavaVersions().merge(this.properties.getJavaVersions());
  metadata.getLanguages().merge(this.properties.getLanguages());
  this.properties.getGroupId().apply(metadata.getGroupId());
  this.properties.getArtifactId().apply(metadata.getArtifactId());
  this.properties.getVersion().apply(metadata.getVersion());
  this.properties.getName().apply(metadata.getName());
  this.properties.getDescription().apply(metadata.getDescription());
  this.properties.getPackageName().apply(metadata.getPackageName());
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addPackaging(String id, boolean defaultValue) {
  this.builder.withCustomizer((it) -> {
    DefaultMetadataElement packaging = new DefaultMetadataElement();
    packaging.setId(id);
    packaging.setName(id);
    packaging.setDefault(defaultValue);
    it.getPackagings().getContent().add(packaging);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addJavaVersion(String version,
    boolean defaultValue) {
  this.builder.withCustomizer((it) -> {
    DefaultMetadataElement element = new DefaultMetadataElement();
    element.setId(version);
    element.setName(version);
    element.setDefault(defaultValue);
    it.getJavaVersions().getContent().add(element);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addLanguage(String id, boolean defaultValue) {
  this.builder.withCustomizer((it) -> {
    DefaultMetadataElement element = new DefaultMetadataElement();
    element.setId(id);
    element.setName(id);
    element.setDefault(defaultValue);
    it.getLanguages().getContent().add(element);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addDependencyGroup(String name, String... ids) {
  this.builder.withCustomizer((it) -> {
    DependencyGroup group = new DependencyGroup();
    group.setName(name);
    for (String id : ids) {
      Dependency dependency = new Dependency();
      dependency.setId(id);
      group.getContent().add(dependency);
    }
    it.getDependencies().getContent().add(group);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder setMavenParent(String groupId, String artifactId,
    String version, boolean includeSpringBootBom) {
  this.builder.withCustomizer((it) -> {
    ParentPom parent = it.getConfiguration().getEnv().getMaven().getParent();
    parent.setGroupId(groupId);
    parent.setArtifactId(artifactId);
    parent.setVersion(version);
    parent.setIncludeSpringBootBom(includeSpringBootBom);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addBootVersion(String id, boolean defaultValue) {
  this.builder.withCustomizer((it) -> {
    DefaultMetadataElement element = new DefaultMetadataElement();
    element.setId(id);
    element.setName(id);
    element.setDefault(defaultValue);
    it.getBootVersions().getContent().add(element);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder setKotlinEnv(String defaultKotlinVersion,
    Kotlin.Mapping... mappings) {
  this.builder.withCustomizer((it) -> {
    it.getConfiguration().getEnv().getKotlin()
        .setDefaultVersion(defaultKotlinVersion);
    for (Kotlin.Mapping mapping : mappings) {
      it.getConfiguration().getEnv().getKotlin().getMappings().add(mapping);
    }
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addBom(String id, BillOfMaterials bom) {
  this.builder.withCustomizer(
      (it) -> it.getConfiguration().getEnv().getBoms().put(id, bom));
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder addDependencyGroup(String name,
    Dependency... dependencies) {
  this.builder.withCustomizer((it) -> {
    DependencyGroup group = new DependencyGroup();
    group.setName(name);
    group.getContent().addAll(Arrays.asList(dependencies));
    it.getDependencies().getContent().add(group);
  });
  return this;
}
origin: spring-io/initializr

public InitializrMetadataTestBuilder setGradleEnv(
    String dependencyManagementPluginVersion) {
  this.builder.withCustomizer((it) -> it.getConfiguration().getEnv().getGradle()
      .setDependencyManagementPluginVersion(dependencyManagementPluginVersion));
  return this;
}
origin: spring-io/initializr

@Test
void invalidParentMissingVersion() {
  InitializrMetadata metadata = initializeMetadata();
  ParentPom parent = metadata.getConfiguration().getEnv().getMaven().getParent();
  parent.setGroupId("org.foo");
  parent.setArtifactId("foo-parent");
  assertThatExceptionOfType(InvalidInitializrMetadataException.class)
      .isThrownBy(metadata::validate).withMessageContaining(
          "Custom maven pom requires groupId, artifactId and version");
}
origin: spring-io/initializr

private static String defaultId(
    Defaultable<? extends DefaultMetadataElement> element) {
  DefaultMetadataElement defaultValue = element.getDefault();
  return (defaultValue != null) ? defaultValue.getId() : null;
}
origin: spring-io/initializr

public void validate() {
  this.maven.parent.validate();
  this.boms.forEach((k, v) -> v.validate());
  this.kotlin.validate();
}
origin: spring-io/initializr

/**
 * Add a {@link InitializrProperties} to be merged with other content.
 * @param properties the settings to merge onto this instance
 * @param mergeConfiguration specify if service configuration should be merged as well
 * @return this instance
 */
public InitializrMetadataBuilder withInitializrProperties(
    InitializrProperties properties, boolean mergeConfiguration) {
  if (mergeConfiguration) {
    this.configuration.merge(properties);
  }
  return withCustomizer(new InitializerPropertiesCustomizer(properties));
}
origin: spring-io/initializr

/**
 * Add a {@link InitializrMetadata} to be merged with other content.
 * @param resource a resource to a json document describing the metadata to include
 * @return this instance
 */
public InitializrMetadataBuilder withInitializrMetadata(Resource resource) {
  return withCustomizer(new ResourceInitializrMetadataCustomizer(resource));
}
origin: spring-io/initializr

/**
 * Create an empty builder instance with a default {@link InitializrConfiguration}.
 * @return a new {@link InitializrMetadataBuilder} instance
 */
public static InitializrMetadataBuilder create() {
  return new InitializrMetadataBuilder(new InitializrConfiguration());
}
io.spring.initializr.metadata

Most used classes

  • Dependency
  • BillOfMaterials
  • DependenciesCapability
  • InitializrConfiguration$Env
  • InitializrConfiguration
  • InitializrMetadataProvider,
  • SingleSelectCapability,
  • TypeCapability,
  • BillOfMaterials$Mapping,
  • DefaultMetadataElement,
  • Dependency$Mapping,
  • InitializrMetadataBuilder,
  • Link,
  • Repository,
  • DependencyGroup,
  • TextCapability,
  • Type,
  • DependencyMetadata,
  • DependencyMetadataProvider
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now