@Test
public void testManifestInjection()
    throws Exception
{

    Path testResource = Paths.get( "src/test/resources/example.jar" );
    Path testJar = workDir.resolve( "manifest.jar" );
    Files.copy( testResource, testJar, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING );
    Artifact artifact = new DefaultArtifact( "org.apache.maven", "maven-model", "xsd", "model", "2.2.1" );
    JarUtils.injectManifest( testJar, artifact );
    try (JarInputStream jis = new JarInputStream( Files.newInputStream( testJar ) ))
    {
        Manifest mf = jis.getManifest();
        assertNotNull( mf );
        Attributes attr = mf.getMainAttributes();
        assertNotNull( attr );
        assertEquals( "org.apache.maven", attr.getValue( "JavaPackages-GroupId" ) );
        assertEquals( "maven-model", attr.getValue( "JavaPackages-ArtifactId" ) );
        assertEquals( "xsd", attr.getValue( "JavaPackages-Extension" ) );
        assertEquals( "model", attr.getValue( "JavaPackages-Classifier" ) );
        assertEquals( "2.2.1", attr.getValue( "JavaPackages-Version" ) );
    }
}