@Test
public void testValidAppProject() throws Exception {

	final String finalName = "output";
	final String version = "1";
	// Copy the project
	File targetDirectory = this.resources.getBasedir( "project--valid" );
	File targetArchive = new File( targetDirectory, "target/" + finalName + ".zip" );
	File modelDirectory = new File( targetDirectory, MavenPluginConstants.TARGET_MODEL_DIRECTORY );
	Assert.assertFalse( targetArchive.exists());
	Assert.assertFalse( modelDirectory.exists());
	// Create the Maven project by hand
	File pom = new File( targetDirectory, "pom.xml" );
	final MavenProject mvnProject = new MavenProject() ;
	mvnProject.setFile( pom ) ;
	mvnProject.setVersion( version );
	mvnProject.getBuild().setDirectory( modelDirectory.getParentFile().getAbsolutePath());
	mvnProject.getBuild().setOutputDirectory( modelDirectory.getAbsolutePath());
	mvnProject.getBuild().setFinalName( finalName );
	mvnProject.setArtifact( new ProjectArtifact( mvnProject ));
	// Copy the resources - mimic what Maven would really do
	Utils.copyDirectory(
			new File( mvnProject.getBasedir(), MavenPluginConstants.SOURCE_MODEL_DIRECTORY ),
			new File( mvnProject.getBuild().getOutputDirectory()));
	// Package
	PackageApplicationMojo packageApplicationMojo = (PackageApplicationMojo) this.rule.lookupMojo( "package-application", pom );
	this.rule.setVariableValueToObject( packageApplicationMojo, "project", mvnProject );
	packageApplicationMojo.execute();
	// Check assertions.
	// Unfortunately, no filtering here.
	Assert.assertTrue( targetArchive.exists());
	targetDirectory = this.folder.newFolder();
	Utils.extractZipArchive( targetArchive, targetDirectory );
	ApplicationLoadResult alr = RuntimeModelIo.loadApplication( targetDirectory );
	Assert.assertEquals( 0, alr.getLoadErrors().size());
	Assert.assertEquals( "1.0.0", alr.getApplicationTemplate().getVersion());
	File notFilteredFile = new File( targetDirectory, "graph/Tomcat/readme.md" );
	Assert.assertTrue( notFilteredFile.exists());
	String content = Utils.readFileContent( notFilteredFile );
	Assert.assertTrue( content.contains( "${project.version}" ));
	Assert.assertFalse( content.contains( "1.0-SNAPSHOT" ));
}