use of org.apache.maven.plugins.assembly.model.Assembly in project maven-plugins by apache.
the class AssemblyInterpolatorTest method testDependencySetOutputFileNameMappingsAreNotInterpolated.
public void testDependencySetOutputFileNameMappingsAreNotInterpolated() throws IOException, AssemblyInterpolationException, AssemblyReadException, InvalidAssemblerConfigurationException {
final Model model = new Model();
model.setArtifactId("artifact-id");
model.setGroupId("group.id");
model.setVersion("1");
model.setPackaging("jar");
final MavenProject project = new MavenProject(model);
final Assembly assembly = new Assembly();
// artifactId is blacklisted, but packaging is not.
final String outputFileNameMapping = "${artifactId}.${packaging}";
final DependencySet set = new DependencySet();
set.setOutputFileNameMapping(outputFileNameMapping);
assembly.addDependencySet(set);
final PojoConfigSource configSourceStub = new PojoConfigSource();
configSourceStub.setRootInterpolator(FixedStringSearchInterpolator.create());
configSourceStub.setEnvironmentInterpolator(FixedStringSearchInterpolator.create());
configSourceStub.setMavenProject(project);
final Assembly outputAssembly = roundTripInterpolation(assembly, configSourceStub);
final List<DependencySet> outputDependencySets = outputAssembly.getDependencySets();
assertEquals(1, outputDependencySets.size());
final DependencySet outputSet = outputDependencySets.get(0);
assertEquals("${artifactId}.${packaging}", outputSet.getOutputFileNameMapping());
}
Aggregations