@ExtendWith({ RepositoryManagementTestExecutionListener.class,

              ArtifactManagementTestExecutionListener.class })
@Test
public void testMavenDependencyGenerationWithClassifier(@MavenRepository(repositoryId = REPOSITORY_RELEASES,
                                                                         setup = MavenIndexedRepositorySetup.class)
                                                        Repository repository,
                                                        @MavenArtifactWithClassifiers(repositoryId = REPOSITORY_RELEASES,
                                                                                      id = GROUP_ID + ":" + ARTIFACT_ID,
                                                                                      versions = { VERSION_2 })
                                                        Path artifactPath)
        throws ProviderImplementationException, IOException
{
    DependencySynonymFormatter formatter = compatibleDependencyFormatRegistry.getProviderImplementation(Maven2LayoutProvider.ALIAS,
                                                                                                        Maven2LayoutProvider.ALIAS);
    assertThat(formatter).as("Failed to look up dependency synonym formatter!").isNotNull();
    MavenArtifactCoordinates coordinates = (MavenArtifactCoordinates) RepositoryFiles.readCoordinates(
            (RepositoryPath) artifactPath.normalize());
    coordinates.setClassifier(CLASSIFIER_SOURCES);
    String snippet = formatter.getDependencySnippet(coordinates);
    System.out.println(snippet);
    assertThat(snippet)
            .as("Failed to generate dependency!")
            .isEqualTo("<dependency>\n" +
                       "    <groupId>org.carlspring.strongbox</groupId>\n" +
                       "    <artifactId>maven-snippet</artifactId>\n" +
                       "    <version>2.0</version>\n" +
                       "    <type>jar</type>\n" +
                       "    <classifier>sources</classifier>\n" +
                       "    <scope>compile</scope>\n" +
                       "</dependency>\n");
}