use of org.apache.maven.plugin.resources.remote.stub.MavenProjectResourcesStub in project maven-plugins by apache.
the class RemoteResourcesMojoTest method testNoBundles.
public void testNoBundles() throws Exception {
final MavenProjectResourcesStub project = createTestProject("default-nobundles");
final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithDefaultSettings(project);
setupDefaultProject(project);
mojo.execute();
}
use of org.apache.maven.plugin.resources.remote.stub.MavenProjectResourcesStub in project maven-plugins by apache.
the class RemoteResourcesMojoTest method testSimpleBundles.
public void testSimpleBundles() throws Exception {
final MavenProjectResourcesStub project = createTestProject("default-simplebundles");
final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings(project, new String[] { "test:test:1.0" });
setupDefaultProject(project);
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject(mojo, "localRepository");
String path = repo.pathOf(new DefaultArtifact("test", "test", VersionRange.createFromVersion("1.0"), null, "jar", "", new DefaultArtifactHandler()));
File file = new File(repo.getBasedir() + "/" + path + ".jar");
file.getParentFile().mkdirs();
buildResourceBundle("default-simplebundles-create", null, new String[] { "SIMPLE.txt" }, file);
mojo.execute();
file = (File) getVariableValueFromObject(mojo, "outputDirectory");
file = new File(file, "SIMPLE.txt");
assertTrue(file.exists());
}
use of org.apache.maven.plugin.resources.remote.stub.MavenProjectResourcesStub in project maven-plugins by apache.
the class RemoteResourcesMojoTest method testFilteredBundles.
public void testFilteredBundles() throws Exception {
final MavenProjectResourcesStub project = createTestProject("default-filterbundles");
final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings(project, new String[] { "test:test:1.1" });
setupDefaultProject(project);
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject(mojo, "localRepository");
String path = repo.pathOf(new DefaultArtifact("test", "test", VersionRange.createFromVersion("1.1"), null, "jar", "", new DefaultArtifactHandler()));
File file = new File(repo.getBasedir() + "/" + path + ".jar");
file.getParentFile().mkdirs();
buildResourceBundle("default-filterbundles-create", null, new String[] { "FILTER.txt.vm" }, file);
mojo.execute();
// executing a second time (example: forked lifecycle) should still work
mojo.execute();
file = (File) getVariableValueFromObject(mojo, "outputDirectory");
file = new File(file, "FILTER.txt");
assertTrue(file.exists());
String data = FileUtils.fileRead(file);
assertTrue(data.contains("2007"));
assertTrue(data.contains("default-filterbundles"));
}
use of org.apache.maven.plugin.resources.remote.stub.MavenProjectResourcesStub in project maven-plugins by apache.
the class RemoteResourcesMojoTest method testSimpleBundlesWithClassifier.
public void testSimpleBundlesWithClassifier() throws Exception {
final MavenProjectResourcesStub project = createTestProject("default-simplebundles");
final ProcessRemoteResourcesMojo mojo = lookupProcessMojoWithSettings(project, new String[] { "test:test:1.0:jar:test" });
setupDefaultProject(project);
ArtifactRepository repo = (ArtifactRepository) getVariableValueFromObject(mojo, "localRepository");
String path = repo.pathOf(new DefaultArtifact("test", "test", VersionRange.createFromVersion("1.0"), null, "jar", "test", new DefaultArtifactHandler()));
File file = new File(repo.getBasedir() + "/" + path + ".jar");
file.getParentFile().mkdirs();
buildResourceBundle("default-simplebundles-create", null, new String[] { "SIMPLE.txt" }, file);
mojo.execute();
file = (File) getVariableValueFromObject(mojo, "outputDirectory");
file = new File(file, "SIMPLE.txt");
assertTrue(file.exists());
}
Aggregations