@Test public void testBuildrDependencyGeneration() throws ProviderImplementationException { DependencySynonymFormatter formatter = compatibleDependencyFormatRegistry.getProviderImplementation(Maven2LayoutProvider.ALIAS, BuildrDependencyFormatter.ALIAS); assertThat(formatter).as("Failed to look up dependency synonym formatter!").isNotNull(); coordinates.setExtension("jar"); String snippet = formatter.getDependencySnippet(coordinates); System.out.print(snippet); assertThat(snippet) .as("Failed to generate dependency!") .isEqualTo("org.carlspring.strongbox:maven-snippet:jar:1.0"); }
@Override public String getDependencySnippet(ArtifactCoordinates artifactCoordinates) { MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) artifactCoordinates; return coordinates.getGroupId() + ":" + coordinates.getArtifactId() + ":" + coordinates.getExtension() + ":" + (coordinates.getClassifier() != null ? coordinates.getClassifier() + ":": "") + coordinates.getVersion(); }
BuildrDependencyFormatter implements DependencySynonymFormatter { @Override public String getDependencySnippet(ArtifactCoordinates artifactCoordinates) { MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) artifactCoordinates; return coordinates.getGroupId() + ":" + coordinates.getArtifactId() + ":" + coordinates.getExtension() + ":" + (coordinates.getClassifier() != null ? coordinates.getClassifier() + ":": "") + coordinates.getVersion(); } }
BuildrDependencyFormatter implements DependencySynonymFormatter { @Override public String getDependencySnippet(ArtifactCoordinates artifactCoordinates) { MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) artifactCoordinates; return coordinates.getGroupId() + ":" + coordinates.getArtifactId() + ":" + coordinates.getExtension() + ":" + (coordinates.getClassifier() != null ? coordinates.getClassifier() + ":": "") + coordinates.getVersion(); }  }
BuildrDependencyFormatter implements DependencySynonymFormatter { @Override public String getDependencySnippet(ArtifactCoordinates artifactCoordinates) { MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) artifactCoordinates; return coordinates.getGroupId() + ":" + coordinates.getArtifactId() + ":" + coordinates.getExtension() + ":" + (coordinates.getClassifier() != null ? coordinates.getClassifier() + ":": "") + coordinates.getVersion(); }  @PostConstruct @Override void register(); @Override String getLayout(); @Override String getFormatAlias(); @Override String getDependencySnippet(ArtifactCoordinates artifactCoordinates); }
BuildrDependencyFormatter implements DependencySynonymFormatter { @Override public String getDependencySnippet(ArtifactCoordinates artifactCoordinates) { MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) artifactCoordinates; return coordinates.getGroupId() + ":" + coordinates.getArtifactId() + ":" + coordinates.getExtension() + ":" + (coordinates.getClassifier() != null ? coordinates.getClassifier() + ":": "") + coordinates.getVersion(); }  @PostConstruct @Override void register(); @Override String getLayout(); @Override String getFormatAlias(); @Override String getDependencySnippet(ArtifactCoordinates artifactCoordinates); static final String ALIAS; }