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