Compare commits

...

7 Commits

10 changed files with 32 additions and 14 deletions

View File

@@ -128,7 +128,7 @@ String inputConnName = null;
}
}
}
if(useDynamicJob){
useIndependentProcess = true;
%>
@@ -207,8 +207,9 @@ String inputConnName = null;
%>
jvm_argument_helper_<%=cid%>.addArgumentsTo(paraList_<%=cid %>, dealChildJobLibrary_<%=cid %>.replaceJarPathsFromCrcMap("<%=commandLineWindows[i] %>"));
<%
}else{
%>
}else if (commandLineWindows[i].indexOf("talend.component.manager.m2.repository")>0) {%>
// nope !
<%}else{%>
jvm_argument_helper_<%=cid%>.addArgumentsTo(paraList_<%=cid %>, "<%=commandLineWindows[i] %>");
<%
}
@@ -246,7 +247,9 @@ String inputConnName = null;
if(param.indexOf(".jar") >= 0){
%>
jvm_argument_helper_<%=cid%>.addArgumentsTo(paraList_<%=cid %>, dealChildJobLibrary_<%=cid %>.replaceJarPathsFromCrcMap(<%=param %>).replace("$ROOT_PATH",System.getProperty("user.dir")));
<%}else{%>
<%}else if (param.indexOf("talend.component.manager.m2.repository")>0) {%>
// nope !
<%}else {%>
jvm_argument_helper_<%=cid%>.addArgumentsTo(paraList_<%=cid %>, <%=param %>);
<%
}

View File

@@ -208,6 +208,13 @@
<include>config/**</include>
</includes>
</fileSet>
<fileSet>
<directory>${current.tacokit.dir}</directory>
<outputDirectory>${file.separator}</outputDirectory>
<includes>
<include>MAVEN-INF/**</include>
</includes>
</fileSet>
</fileSets>
<dependencySets></dependencySets>
</assembly>

View File

@@ -42,6 +42,9 @@
<current.resources.dir>${basedir}/src/main/ext-resources</current.resources.dir>
<current.bundle.resources.dir>${basedir}/src/main/bundle-resources</current.bundle.resources.dir>
<current.test.resources.dir>${basedir}/src/test/resources</current.test.resources.dir>
<current.maven-inf.dir>${basedir}/src/main/tacokit-resources/MAVEN-INF</current.maven-inf.dir>
<current.talend-inf.dir>${basedir}/src/main/tacokit-resources/TALEND-INF</current.talend-inf.dir>
<current.tacokit.dir>${basedir}/src/main/tacokit-resources</current.tacokit.dir>
</properties>
<dependencies>

View File

@@ -1,3 +1,3 @@
%~d0
cd %~dp0
java -Dtalend.component.manager.m2.repository="%cd%/../lib" ${talend.job.jvmargs} -cp ${talend.job.bat.classpath} ${talend.job.class} ${talend.job.bat.addition} %*
java -Dtalend.component.manager.m2.repository="%cd%/../MAVEN-INF/repository" ${talend.job.jvmargs} -cp ${talend.job.bat.classpath} ${talend.job.class} ${talend.job.bat.addition} %*

View File

@@ -1,3 +1,3 @@
$fileDir = Split-Path -Parent $MyInvocation.MyCommand.Path
cd $fileDir
java '-Dtalend.component.manager.m2.repository=%cd%/../lib' ${talend.job.jvmargs.ps1} -cp ${talend.job.ps1.classpath} ${talend.job.class} ${talend.job.bat.addition} $args
java '-Dtalend.component.manager.m2.repository=%cd%/../MAVEN-INF/repository' ${talend.job.jvmargs.ps1} -cp ${talend.job.ps1.classpath} ${talend.job.class} ${talend.job.bat.addition} $args

View File

@@ -1,4 +1,4 @@
#!/bin/sh
cd `dirname $0`
ROOT_PATH=`pwd`
java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib ${talend.job.jvmargs} -cp ${talend.job.sh.classpath} ${talend.job.class} ${talend.job.sh.addition} "$@"
java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../MAVEN-INF/repository ${talend.job.jvmargs} -cp ${talend.job.sh.classpath} ${talend.job.class} ${talend.job.sh.addition} "$@"

View File

@@ -1224,7 +1224,7 @@ public class JavaProcessor extends AbstractJavaProcessor implements IJavaBreakpo
list.addAll(Arrays.asList(cmd2));
if (isStandardJob() && isExternalUse()) {
// for dynamic/independent subjob
localM2Path += "../lib"; //$NON-NLS-1$
localM2Path += "../MAVEN-INF/repository"; //$NON-NLS-1$
insertArgument(list, localM2Path);
}
return list.toArray(new String[0]);

View File

@@ -144,6 +144,10 @@ public class TalendProcessJavaProject implements ITalendProcessJavaProject {
public IFolder getExternalResourcesFolder() {
return createFolder(MavenSystemFolders.EXT_RESOURCES.getPath());
}
@Override
public IFolder getTaCoKitResourcesFolder() {
return createFolder(MavenSystemFolders.TCK_RESOURCES.getPath());
}
@Override
public IFolder getBundleResourcesFolder() {

View File

@@ -287,7 +287,8 @@ public class BuildJobHandler extends AbstractBuildJobHandler {
while (relativepath.hasNext()) {
String relativePath = relativepath.next();
// TDQ-12852 do nothing if it is DQ resources.
if (relativePath == null || relativePath.contains("metadata/survivorship")) { //$NON-NLS-1$
if (relativePath == null || relativePath.contains("metadata/survivorship") || relativePath
.startsWith("MAVEN-INF") || relativePath.startsWith("TALEND-INF")) { //$NON-NLS-1$
continue;
}
Set<URL> sources = resouece.getResourcesByRelativePath(relativePath);

View File

@@ -40,8 +40,6 @@ import org.talend.commons.utils.system.EnvironmentUtils;
import org.talend.core.CorePlugin;
import org.talend.core.model.properties.Item;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.repository.build.BuildExportManager;
import org.talend.core.runtime.repository.build.BuildExportManager.EXPORT_TYPE;
import org.talend.core.runtime.repository.build.IBuildExportDependenciesProvider;
import org.talend.repository.documentation.ExportFileResource;
import org.talend.sdk.component.studio.ComponentModel;
@@ -65,8 +63,7 @@ public class TacokitExportDependenciesProvider implements IBuildExportDependenci
*/
@Override
public void exportDependencies(final ExportFileResource exportFileResource, final Item item) {
if (!BuildExportManager.getInstance().getCurrentExportType()
.equals(EXPORT_TYPE.OSGI) || !hasTaCoKitComponents(getJobComponents(item))) {
if (!hasTaCoKitComponents(getJobComponents(item))) {
return;
}
LOG.debug("[exportDependencies] Searching for TaCoKit components...");
@@ -81,11 +78,14 @@ public class TacokitExportDependenciesProvider implements IBuildExportDependenci
ITalendProcessJavaProject project = CorePlugin.getDefault().getRunProcessService()
.getTalendJobJavaProject(item.getProperty());
final String output = EnvironmentUtils.isWindowsSystem() ?
project.getTaCoKitResourcesFolder().getLocationURI().getPath().substring(1) :
project.getTaCoKitResourcesFolder().getLocationURI().getPath();
final String resources = EnvironmentUtils.isWindowsSystem() ?
project.getResourcesFolder().getLocationURI().getPath().substring(1) :
project.getResourcesFolder().getLocationURI().getPath();
final Path m2 = findM2Path();
final Path resM2 = Paths.get(output, TaCoKitConst.MAVEN_INF, "repository");
final Path coordinates = Paths.get(output, TaCoKitConst.TALEND_INF, "plugins.properties");
final Path coordinates = Paths.get(resources, TaCoKitConst.TALEND_INF, "plugins.properties");
exportFileResource.addResource("TALEND-INF/", coordinates.toUri().toURL());
Files.createDirectories(resM2);
if (Files.exists(coordinates)) {