use of org.codehaus.plexus.util.xml.Xpp3Dom in project tesb-studio-se by Talend.
the class CreateMavenBundlePom method addSkipMavenCleanPlugin.
/**
* Skip clean control-bundle file in target folde, in case of using mvn clean + package goal
*
* @return plugin
*/
private Plugin addSkipMavenCleanPlugin() {
Plugin plugin = new Plugin();
plugin.setGroupId("org.apache.maven.plugins");
plugin.setArtifactId("maven-clean-plugin");
plugin.setVersion("3.0.0");
Xpp3Dom configuration = new Xpp3Dom("configuration");
Xpp3Dom skipClean = new Xpp3Dom("skip");
skipClean.setValue("true");
configuration.addChild(skipClean);
plugin.setConfiguration(configuration);
return plugin;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tesb-studio-se by Talend.
the class CreateMavenBundlePom method addSkipDeployFeatureMavenPlugin.
private Plugin addSkipDeployFeatureMavenPlugin() {
Plugin plugin = new Plugin();
plugin.setGroupId("org.apache.maven.plugins");
plugin.setArtifactId("maven-deploy-plugin");
plugin.setVersion("2.7");
Xpp3Dom configuration = new Xpp3Dom("configuration");
Xpp3Dom skip = new Xpp3Dom("skip");
skip.setValue("true");
configuration.addChild(skip);
plugin.setConfiguration(configuration);
return plugin;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tesb-studio-se by Talend.
the class CreateMavenBundlePom method createInstallFileElement.
private Xpp3Dom createInstallFileElement(JobInfo job) {
Xpp3Dom file = null;
if (getJobProcessor() != null && getProcessor(job) != null) {
IPath currentProjectRootDir = getTalendJobJavaProject(getJobProcessor()).getProject().getLocation();
IPath targetDir = getTalendJobJavaProject(getProcessor(job)).getTargetFolder().getLocation();
String relativeTargetDir = targetDir.makeRelativeTo(currentProjectRootDir).toString();
if (!ProjectManager.getInstance().isInCurrentMainProject(job.getProcessItem().getProperty())) {
// this job/routelet is from a reference project
currentProjectRootDir = new Path(currentProjectRootDir.getDevice(), currentProjectRootDir.toString().replaceAll("/\\d+/", "/"));
targetDir = new Path(targetDir.getDevice(), targetDir.toString().replaceAll("/\\d+/", "/"));
relativeTargetDir = targetDir.makeRelativeTo(currentProjectRootDir).toString();
}
IFile jobPom = AggregatorPomsHelper.getItemPomFolder(job.getProcessItem().getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
if (jobPom.exists()) {
try {
Model jobModel = MODEL_MANAGER.readMavenModel(jobPom);
String resolvedFinalName = null;
if (jobModel.getProperties().getProperty(JOB_FINAL_NAME) != null) {
resolvedFinalName = resolveJobFinalName(jobModel.getProperties().getProperty(JOB_FINAL_NAME), jobModel);
} else {
for (String modelName : jobModel.getModules()) {
IFile subPom = AggregatorPomsHelper.getItemPomFolder(job.getProcessItem().getProperty()).getFile(modelName);
if (subPom.exists()) {
Model subModel = MODEL_MANAGER.readMavenModel(subPom);
if (subModel.getProperties().getProperty(JOB_FINAL_NAME) != null) {
resolvedFinalName = resolveJobFinalName(subModel.getProperties().getProperty(JOB_FINAL_NAME), subModel);
break;
}
}
}
}
if (resolvedFinalName == null) {
resolvedFinalName = job.getJobName().toLowerCase() + "_" + PomIdsHelper.getJobVersion(job).replaceAll("\\.", "_");
}
String pathToJar = relativeTargetDir + Path.SEPARATOR + resolvedFinalName + ".jar";
file = new Xpp3Dom("file");
file.setValue(pathToJar);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
return file;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tesb-studio-se by Talend.
the class CreateMavenDataServicePom method addControlBundleMavenPlugin.
private Plugin addControlBundleMavenPlugin() {
Plugin plugin = new Plugin();
plugin.setGroupId("org.apache.maven.plugins");
plugin.setArtifactId("maven-jar-plugin");
plugin.setVersion("3.0.2");
plugin.setExtensions(true);
Xpp3Dom configuration = new Xpp3Dom("configuration");
Xpp3Dom archive = new Xpp3Dom("archive");
Xpp3Dom manifest = new Xpp3Dom("manifestFile");
manifest.setValue("${project.build.outputDirectory}/META-INF/MANIFEST.MF");
archive.addChild(manifest);
configuration.addChild(archive);
plugin.setConfiguration(configuration);
return plugin;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tesb-studio-se by Talend.
the class CreateMavenDataServicePom method addSkipDeployFeatureMavenPlugin.
private Plugin addSkipDeployFeatureMavenPlugin() {
Plugin plugin = new Plugin();
plugin.setGroupId("org.apache.maven.plugins");
plugin.setArtifactId("maven-deploy-plugin");
plugin.setVersion("2.7");
Xpp3Dom configuration = new Xpp3Dom("configuration");
Xpp3Dom skip = new Xpp3Dom("skip");
skip.setValue("true");
configuration.addChild(skip);
plugin.setConfiguration(configuration);
return plugin;
}
Aggregations