TUP-2922: add new command to build project sources
This commit is contained in:
@@ -96,50 +96,55 @@
|
||||
</fileSet>
|
||||
<!-- If have children jobs, will add here -->
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>org.talend.libraries:*</include>
|
||||
</includes>
|
||||
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}
|
||||
</outputFileNameMapping>
|
||||
<useProjectArtifact>false</useProjectArtifact>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>org.talend.libraries:*</exclude>
|
||||
</excludes>
|
||||
<useProjectArtifact>false</useProjectArtifact>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<moduleSets>
|
||||
<moduleSet>
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>org.talend.job:*</include>
|
||||
</includes>
|
||||
<binaries>
|
||||
<outputDirectory>${talend.job.name}</outputDirectory>
|
||||
<includeDependencies>false</includeDependencies>
|
||||
<unpack>false</unpack>
|
||||
<!-- <outputFileNameMapping>${module.artifactId}_${module.version}.${module.extension}
|
||||
</outputFileNameMapping> -->
|
||||
</binaries>
|
||||
</moduleSet>
|
||||
<moduleSet><!-- only for routines -->
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>org.talend.code:*</include>
|
||||
</includes>
|
||||
<binaries>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<includeDependencies>false</includeDependencies>
|
||||
<unpack>false</unpack>
|
||||
<outputFileNameMapping>${module.artifactId}.${module.extension}
|
||||
</outputFileNameMapping>
|
||||
</binaries>
|
||||
</moduleSet>
|
||||
</moduleSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>org.talend.libraries:*</include>
|
||||
</includes>
|
||||
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}
|
||||
</outputFileNameMapping>
|
||||
<useProjectArtifact>false</useProjectArtifact>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>org.talend.libraries:*</exclude>
|
||||
<exclude>${artifact.groupId}:*</exclude>
|
||||
</excludes>
|
||||
<useProjectArtifact>false</useProjectArtifact>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<moduleSets>
|
||||
<moduleSet>
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>${artifact.groupId}:${artifact.artifactId}</include>
|
||||
</includes>
|
||||
<binaries>
|
||||
<outputDirectory>${talend.job.name}</outputDirectory>
|
||||
<includeDependencies>true</includeDependencies>
|
||||
<unpack>false</unpack>
|
||||
<includes>
|
||||
<include>org.talend.job:*</include>
|
||||
</includes>
|
||||
<!-- <outputFileNameMapping>${module.artifactId}_${module.version}.${module.extension}
|
||||
</outputFileNameMapping> -->
|
||||
</binaries>
|
||||
</moduleSet>
|
||||
<moduleSet>
|
||||
<!-- only for routines -->
|
||||
<useAllReactorProjects>true</useAllReactorProjects>
|
||||
<includes>
|
||||
<include>org.talend.code:*</include>
|
||||
</includes>
|
||||
<binaries>
|
||||
<outputDirectory>${talend.job.name}/lib</outputDirectory>
|
||||
<includeDependencies>false</includeDependencies>
|
||||
<unpack>false</unpack>
|
||||
<outputFileNameMapping>${module.artifactId}.${module.extension}
|
||||
</outputFileNameMapping>
|
||||
</binaries>
|
||||
</moduleSet>
|
||||
</moduleSets>
|
||||
</assembly>
|
||||
|
||||
@@ -55,16 +55,12 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- only compile the job source -->
|
||||
<include>${talend.job.path}/*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- only compile the job source -->
|
||||
<include>${talend.job.path}/*</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -67,19 +67,5 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin><!-- won't compile any files, try to compile in the sub-modules selves. -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<phase>none</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<!-- <configuration> <excludes> <exclude>**/*.*</exclude> </excludes>
|
||||
</configuration> -->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -34,16 +34,12 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- only compile the routines source -->
|
||||
<include>${talend.routines.package}/**</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<includes>
|
||||
<!-- only compile the routines source -->
|
||||
<include>${talend.routines.package}/**</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -18,9 +18,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.designer.runprocess.ProcessorException;
|
||||
@@ -49,6 +53,17 @@ public class ProcessorDependenciesManager {
|
||||
neededDependencies.add(dependency);
|
||||
}
|
||||
}
|
||||
String parentId = processor.getProperty().getId();
|
||||
Set<JobInfo> jobInfos = processor.getBuildChildrenJobs();
|
||||
for (JobInfo jobInfo : jobInfos) {
|
||||
// if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
|
||||
Dependency dependency = new Dependency();
|
||||
dependency.setGroupId(TalendMavenConstants.DEFAULT_JOB_GROUP_ID);
|
||||
dependency.setArtifactId(jobInfo.getJobName());
|
||||
dependency.setVersion(jobInfo.getJobVersion());
|
||||
neededDependencies.add(dependency);
|
||||
// }
|
||||
}
|
||||
|
||||
return updateDependencies(progressMonitor, model, neededDependencies, false);
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.RepositorySystemSession;
|
||||
import org.eclipse.aether.artifact.Artifact;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.connector.wagon.WagonRepositoryConnectorFactory;
|
||||
import org.eclipse.aether.deployment.DeployRequest;
|
||||
import org.eclipse.aether.deployment.DeployResult;
|
||||
import org.eclipse.aether.impl.DefaultServiceLocator;
|
||||
@@ -104,6 +105,7 @@ public class LocalRepositoryAetherManager extends LocalRepositoryManager {
|
||||
protected RepositorySystem newRepositorySystem() {
|
||||
DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
|
||||
locator.addService(RepositoryConnectorFactory.class, AetherRepositoryConnectorFactory.class);
|
||||
locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);
|
||||
|
||||
// locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
|
||||
// locator.addService(TransporterFactory.class, FileTransporterFactory.class);
|
||||
|
||||
@@ -39,17 +39,17 @@ public abstract class LocalRepositoryManager {
|
||||
|
||||
public static final LocalRepositoryManager LAUNCHER;
|
||||
|
||||
public static final LocalRepositoryManager AETHER;
|
||||
// public static final LocalRepositoryManager AETHER;
|
||||
static {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
IProject project = processService.getTalendProcessJavaProject().getProject();
|
||||
LAUNCHER = new LocalRepsitoryLauncherManager(project);
|
||||
AETHER = new LocalRepositoryAetherManager(project.getLocation().toFile());
|
||||
// AETHER = new LocalRepositoryAetherManager(project.getLocation().toFile());
|
||||
} else {
|
||||
LAUNCHER = null;
|
||||
AETHER = null;
|
||||
// AETHER = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,9 @@ public class PomUtil {
|
||||
}
|
||||
String jarPath = libService.getJarPath(d.getArtifactId() + '.' + type);
|
||||
try {
|
||||
installJar(repoManager, new File(jarPath), PomUtil.convertToArtifact(d));
|
||||
if (jarPath != null) {
|
||||
installJar(repoManager, new File(jarPath), PomUtil.convertToArtifact(d));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jdt.launching.IVMInstall;
|
||||
import org.eclipse.jdt.launching.JavaRuntime;
|
||||
import org.eclipse.m2e.core.internal.IMavenConstants;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
import org.talend.designer.maven.tools.creator.CreateMavenCodeProject;
|
||||
|
||||
Reference in New Issue
Block a user