Compare commits
33 Commits
master
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
800fae8bd9 | ||
|
|
2b181edd45 | ||
|
|
8387c608eb | ||
|
|
2992c46dda | ||
|
|
4c7095f33d | ||
|
|
dbb2a897a7 | ||
|
|
7183fed038 | ||
|
|
b524d1e492 | ||
|
|
3c501a0a40 | ||
|
|
45fc1fea8b | ||
|
|
383c0e4a4a | ||
|
|
474eae8f29 | ||
|
|
445b472cdb | ||
|
|
4dc429d0ea | ||
|
|
757472a9fa | ||
|
|
13be127b12 | ||
|
|
daa391c055 | ||
|
|
92a79ffb46 | ||
|
|
dd180cf9ea | ||
|
|
cb2a972cb3 | ||
|
|
ff4e6ff62f | ||
|
|
7fd807ca69 | ||
|
|
6f7d03f999 | ||
|
|
c500a6bc34 | ||
|
|
86f71023b2 | ||
|
|
4d2a9ec311 | ||
|
|
98cf6925a3 | ||
|
|
c4e61238b4 | ||
|
|
92f6bf84a1 | ||
|
|
049179f69b | ||
|
|
15421355b9 | ||
|
|
8d81cd141d | ||
|
|
780dde1d8b |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.common.ui.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.repository.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.runtime.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.edit.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.helpers.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.librariesmanager.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.librariesmanager.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.metadata.managment.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.metadata.managment.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.migrationTool.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.edit.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.presentation.onboarding.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.registration.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.items.importexport.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.items.importexport.ui.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.localprovider.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.mdm.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.metadata.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.repository.view.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.resources.nl</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.fragment.jars.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.help.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.jdt.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.jdbc.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.m2e.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.model.migration.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.rcp.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.update.p2.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.updates.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.utils.feature</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.common.ui.runtime</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.runtime</artifactId>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend</groupId>
|
||||
<artifactId>org.talend.tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../pom_server.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.net.URL;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
@@ -154,5 +155,9 @@ public class CommonsPlugin implements BundleActivator {
|
||||
public static void setESBMicorservice(boolean isESBMicorservice) {
|
||||
CommonsPlugin.isESBMicorservice = isESBMicorservice;
|
||||
}
|
||||
|
||||
public static void setMavenOfflineState(boolean state) {
|
||||
InstanceScope.INSTANCE.getNode("org.eclipse.m2e.core").putBoolean("eclipse.m2.offline", state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.commons.ui</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.repository</artifactId>
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.talend.commons.utils.time.TimeMeasure;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ICoreService;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.login.AbstractLoginTask;
|
||||
import org.talend.repository.ProjectManager;
|
||||
|
||||
@@ -60,11 +61,25 @@ public class SyncLibrariesLoginTask extends AbstractLoginTask implements IRunnab
|
||||
if (monitor != null && monitor.isCanceled()) {
|
||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
if (runProcessService != null) {
|
||||
runProcessService.initializeRootPoms();
|
||||
}
|
||||
TimeMeasure.end("SyncLibraries");
|
||||
TimeMeasure.display = false;
|
||||
TimeMeasure.displaySteps = false;
|
||||
TimeMeasure.measureActive = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC nrousseau Comment method "getRunProcessService".
|
||||
* @return
|
||||
*/
|
||||
private IRunProcessService getRunProcessService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
return (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1954,6 +1954,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
fireRepositoryPropertyChange(ERepositoryActionName.PROJECT_PREFERENCES_RELOAD.getName(), null, null);
|
||||
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
if (runProcessService != null) {
|
||||
runProcessService.initMavenJavaProject(monitor, project);
|
||||
}
|
||||
|
||||
currentMonitor = subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE);
|
||||
currentMonitor.beginTask(Messages.getString("ProxyRepositoryFactory.exec.migration.tasks"), 1); //$NON-NLS-1$
|
||||
ProjectManager.getInstance().getMigrationRecords().clear();
|
||||
@@ -1964,8 +1969,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
getRunProcessService().initMavenJavaProject(monitor, project);
|
||||
|
||||
ICoreService coreService = getCoreService();
|
||||
if (coreService != null) {
|
||||
// clean workspace
|
||||
@@ -2016,11 +2019,16 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
TimeMeasure.step("logOnProject", "sync repository (routines/rules/beans)"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
// log4j prefs
|
||||
if (coreUiService != null) {
|
||||
if (coreUiService != null && coreService != null) {
|
||||
coreService.syncLog4jSettings(null);
|
||||
TimeMeasure.step("logOnProject", "sync log4j"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
TimeMeasure.step("logOnProject", "sync log4j"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
if (runProcessService != null) {
|
||||
runProcessService.initializeRootPoms();
|
||||
|
||||
TimeMeasure.step("logOnProject", "install / setup root poms"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
|
||||
ITDQRepositoryService tdqRepositoryService = (ITDQRepositoryService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITDQRepositoryService.class);
|
||||
@@ -2084,7 +2092,10 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
root.dispose();
|
||||
}
|
||||
}
|
||||
getRunProcessService().deleteEclipseProjects();
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
if (runProcessService != null) {
|
||||
runProcessService.deleteEclipseProjects();
|
||||
}
|
||||
ReferenceProjectProvider.clearTacReferenceList();
|
||||
ReferenceProjectProblemManager.getInstance().clearAll();
|
||||
fullLogonFinished = false;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.runtime</artifactId>
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.utils.IXSDPopulationUtil;
|
||||
import org.talend.repository.model.IRepositoryNode;
|
||||
@@ -63,4 +64,13 @@ public interface IESBService extends IService {
|
||||
public Item getWSDLEditorItem(IWorkbenchPart part);
|
||||
|
||||
public boolean executeCommand(IEditorPart editorPart, Object cmd);
|
||||
|
||||
/**
|
||||
* DOC dsergent Comment method "getDefaultGroupIdSuffix". Default group ids for deployment get a suffix according to
|
||||
* the kind of process (TESB-21282)
|
||||
*
|
||||
* @param property
|
||||
* @return Appropriate suffix for group id: route, job or service
|
||||
*/
|
||||
public String getDefaultGroupIdSuffix(Property property);
|
||||
}
|
||||
|
||||
@@ -891,7 +891,8 @@ public final class ProcessUtils {
|
||||
if (property != null && property.getItem() != null) { // same as isStandardJob in JavaProcessor
|
||||
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(property.getItem());
|
||||
// route job
|
||||
if (itemType != null && itemType.equals(ERepositoryObjectType.PROCESS_ROUTE)) {
|
||||
if (itemType != null && (itemType.equals(ERepositoryObjectType.PROCESS_ROUTE)
|
||||
|| itemType.equals(ERepositoryObjectType.PROCESS_ROUTELET))) {
|
||||
needBeans = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ public abstract class AbstractScriptProjectSettingPage extends AbstractProjectSe
|
||||
|
||||
protected abstract String getHeadTitle();
|
||||
|
||||
protected StyledText getScriptTxt() {
|
||||
return scriptTxt;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createContents(Composite p) {
|
||||
Composite parent = (Composite) super.createContents(p);
|
||||
|
||||
@@ -108,7 +108,7 @@ public final class ProjectPreferenceManager {
|
||||
this.qualifier = fileName;
|
||||
this.project = project;
|
||||
this.projectScope = new ProjectScope(project);
|
||||
this.store = new ScopedPreferenceStore(this.projectScope, this.qualifier, project.getName()+"."+this.qualifier); //$NON-NLS-1$
|
||||
this.store = new ScopedPreferenceStore(this.projectScope, this.qualifier);
|
||||
}
|
||||
|
||||
private void addPropertyChangeListener() {
|
||||
|
||||
@@ -191,4 +191,6 @@ public interface IDesignerCoreService extends IService {
|
||||
public int getTACReadTimeout();
|
||||
|
||||
public void setTACReadTimeout(int timeout);
|
||||
|
||||
boolean isDelegateNode(INode node);
|
||||
}
|
||||
|
||||
@@ -293,6 +293,8 @@ public interface IProcessor {
|
||||
String[] getJVMArgs();
|
||||
|
||||
Set<ModuleNeeded> getNeededModules();
|
||||
|
||||
Set<ModuleNeeded> getNeededModules(boolean withChildrenJobs);
|
||||
|
||||
Set<JobInfo> getBuildChildrenJobs();
|
||||
|
||||
|
||||
@@ -218,5 +218,7 @@ public interface IRunProcessService extends IService {
|
||||
boolean isExportConfig();
|
||||
|
||||
void generateJobPom(ProcessItem processItem);
|
||||
|
||||
void initializeRootPoms();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core.ui</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.core</artifactId>
|
||||
|
||||
@@ -74,6 +74,7 @@ import org.talend.designer.codegen.ITalendSynchronizer;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.designer.runprocess.ProcessorUtilities;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
@@ -359,13 +360,13 @@ public class CoreService implements ICoreService {
|
||||
}
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
if (url != null) {
|
||||
// set the project mappings url
|
||||
System.setProperty("talend.mappings.url", url.toString()); //$NON-NLS-1$
|
||||
// set the project mappings url
|
||||
System.setProperty(ProcessorUtilities.PROP_MAPPINGS_URL, url.toString()); //$NON-NLS-1$
|
||||
IFolder xmlMappingFolder = talendJavaProject.getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
|
||||
|
||||
File mappingSource = new File(url.getPath());
|
||||
FilenameFilter filter = new FilenameFilter() {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
if (XmlUtil.isXMLFile(name)) {
|
||||
@@ -374,7 +375,7 @@ public class CoreService implements ICoreService {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
for (File file : mappingSource.listFiles(filter)) {
|
||||
String targetName = getTargetName(file);
|
||||
IFile targetFile = xmlMappingFolder.getFile(targetName);
|
||||
|
||||
@@ -111,6 +111,8 @@ public class ProcessorUtilities {
|
||||
|
||||
private static Logger log = Logger.getLogger(ProcessorUtilities.class);
|
||||
|
||||
public static final String PROP_MAPPINGS_URL = "talend.mappings.url"; //$NON-NLS-1$
|
||||
|
||||
public static final int GENERATE_MAIN_ONLY = TalendProcessOptionConstants.GENERATE_MAIN_ONLY;
|
||||
|
||||
public static final int GENERATE_WITH_FIRST_CHILD = TalendProcessOptionConstants.GENERATE_WITH_FIRST_CHILD;
|
||||
@@ -275,8 +277,10 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
IRunProcessService service = CorePlugin.getDefault().getRunProcessService();
|
||||
IProcessor processor = service.createCodeProcessor(process, curProperty, ((RepositoryContext) CorePlugin.getContext()
|
||||
.getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage(), true);
|
||||
IProcessor processor = service.createCodeProcessor(process, curProperty,
|
||||
((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject()
|
||||
.getLanguage(),
|
||||
true);
|
||||
return processor;
|
||||
}
|
||||
|
||||
@@ -374,9 +378,8 @@ public class ProcessorUtilities {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static IProcessor generateCode(IProcessor processor2, JobInfo jobInfo, String selectedContextName,
|
||||
boolean statistics, boolean trace, boolean needContext, int option, IProgressMonitor progressMonitor)
|
||||
throws ProcessorException {
|
||||
private static IProcessor generateCode(IProcessor processor2, JobInfo jobInfo, String selectedContextName, boolean statistics,
|
||||
boolean trace, boolean needContext, int option, IProgressMonitor progressMonitor) throws ProcessorException {
|
||||
needContextInCurrentGeneration = needContext;
|
||||
if (progressMonitor == null) {
|
||||
progressMonitor = new NullProgressMonitor();
|
||||
@@ -503,24 +506,27 @@ public class ProcessorUtilities {
|
||||
Set<ModuleNeeded> neededLibraries = CorePlugin.getDefault().getDesignerCoreService()
|
||||
.getNeededLibrariesForProcess(currentProcess, false);
|
||||
if (neededLibraries != null) {
|
||||
Set<ModuleNeeded> adjustClassPath = new HashSet<ModuleNeeded>(neededLibraries);
|
||||
for (IClasspathAdjuster adjuster : classPathAdjusters) {
|
||||
adjuster.collectInfo(currentProcess, neededLibraries);
|
||||
adjustClassPath = adjuster.adjustClassPath(currentProcess, adjustClassPath);
|
||||
}
|
||||
|
||||
LastGenerationInfo.getInstance().setModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(),
|
||||
adjustClassPath);
|
||||
LastGenerationInfo.getInstance().setModulesNeededPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(), adjustClassPath);
|
||||
|
||||
neededLibraries);
|
||||
LastGenerationInfo.getInstance().setModulesNeededPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(), neededLibraries);
|
||||
// must install the needed libraries before generate codes with poms.
|
||||
CorePlugin.getDefault().getRunProcessService()
|
||||
.updateLibraries(adjustClassPath, currentProcess, retrievedJarsForCurrentBuild);
|
||||
CorePlugin.getDefault().getRunProcessService().updateLibraries(neededLibraries, currentProcess,
|
||||
retrievedJarsForCurrentBuild);
|
||||
|
||||
}
|
||||
resetRunJobComponentParameterForContextApply(jobInfo, currentProcess, selectedContextName);
|
||||
|
||||
generateNodeInfo(jobInfo, selectedContextName, statistics, needContext, option, progressMonitor, currentProcess);
|
||||
|
||||
if (neededLibraries != null) {
|
||||
Set<ModuleNeeded> adjustClassPath = new HashSet<>(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()));
|
||||
for (IClasspathAdjuster adjuster : classPathAdjusters) {
|
||||
adjuster.collectInfo(currentProcess, adjustClassPath);
|
||||
adjustClassPath = adjuster.adjustClassPath(currentProcess, adjustClassPath);
|
||||
}
|
||||
LastGenerationInfo.getInstance().setModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(),
|
||||
adjustClassPath);
|
||||
}
|
||||
final Map<String, Object> argumentsMap = new HashMap<String, Object>();
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_STATS, statistics);
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_TRACS, trace);
|
||||
@@ -578,8 +584,8 @@ public class ProcessorUtilities {
|
||||
// update calss path before export pigudf
|
||||
Set<ModuleNeeded> neededModules = LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),
|
||||
jobInfo.getJobVersion());
|
||||
Set<String> pigudfNeededWithSubjobPerJob = LastGenerationInfo.getInstance().getPigudfNeededWithSubjobPerJob(
|
||||
jobInfo.getJobId(), jobInfo.getJobVersion());
|
||||
Set<String> pigudfNeededWithSubjobPerJob = LastGenerationInfo.getInstance()
|
||||
.getPigudfNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion());
|
||||
String pigModuleName = null;
|
||||
if (selectedProcessItem != null && !pigudfNeededWithSubjobPerJob.isEmpty()) {
|
||||
CorePlugin.getDefault().getRunProcessService().updateLibraries(neededModules, currentProcess);
|
||||
@@ -605,11 +611,14 @@ public class ProcessorUtilities {
|
||||
URL url = MetadataTalendType.getProjectForderURLOfMappingsFile();
|
||||
if (url != null) {
|
||||
// set the project mappings url
|
||||
System.setProperty("talend.mappings.url", url.toString()); //$NON-NLS-1$
|
||||
System.setProperty(ProcessorUtilities.PROP_MAPPINGS_URL, url.toString()); // $NON-NLS-1$
|
||||
|
||||
IFolder xmlMappingFolder = jobInfo.getProcessor().getTalendJavaProject().getResourceSubFolder(null, JavaUtils.JAVA_XML_MAPPING);
|
||||
if (xmlMappingFolder.members().length == 0 && GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
ICoreService coreService = (ICoreService) GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
IFolder xmlMappingFolder = jobInfo.getProcessor().getTalendJavaProject().getResourceSubFolder(null,
|
||||
JavaUtils.JAVA_XML_MAPPING);
|
||||
if (xmlMappingFolder.members().length == 0
|
||||
&& GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
ICoreService coreService = (ICoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(ICoreService.class);
|
||||
coreService.synchronizeMapptingXML(jobInfo.getProcessor().getTalendJavaProject());
|
||||
}
|
||||
}
|
||||
@@ -629,6 +638,16 @@ public class ProcessorUtilities {
|
||||
|
||||
public static boolean hasMetadataDynamic(IProcess currentProcess, JobInfo jobInfo) {
|
||||
boolean hasDynamicMetadata = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
|
||||
IDesignerCoreService designerCoreService = (IDesignerCoreService) GlobalServiceRegister.getDefault()
|
||||
.getService(IDesignerCoreService.class);
|
||||
for (INode node : currentProcess.getGraphicalNodes()) {
|
||||
if (designerCoreService.isDelegateNode(node)) { // for jdbc, currently
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
out: for (INode node : (List<? extends INode>) currentProcess.getGeneratingNodes()) {
|
||||
if (node.getComponent() != null && node.getComponent().getComponentType() == EComponentType.GENERIC) {
|
||||
// generic component, true always
|
||||
@@ -637,9 +656,9 @@ public class ProcessorUtilities {
|
||||
// to check if node is db component , maybe need modification
|
||||
boolean isDbNode = false;
|
||||
for (IElementParameter param : (List<? extends IElementParameter>) node.getElementParameters()) {
|
||||
if(EParameterFieldType.TEXT == param.getFieldType() && param.getValue() != null){
|
||||
if(("TYPE".equals(param.getName()) && !"".equals(param.getValue())) ||
|
||||
("FAMILY".equals(param.getName()) && param.getValue().toString().startsWith("Database"))){
|
||||
if (EParameterFieldType.TEXT == param.getFieldType() && param.getValue() != null) {
|
||||
if (("TYPE".equals(param.getName()) && !"".equals(param.getValue()))
|
||||
|| ("FAMILY".equals(param.getName()) && param.getValue().toString().startsWith("Database"))) {
|
||||
isDbNode = true;
|
||||
break;
|
||||
}
|
||||
@@ -664,7 +683,7 @@ public class ProcessorUtilities {
|
||||
jobInfo.setProcess(null);
|
||||
jobInfo.setProcessor(null);
|
||||
progressMonitor.subTask(Messages.getString("ProcessorUtilities.finalizeBuild") + currentJobName); //$NON-NLS-1$
|
||||
|
||||
|
||||
final String timeMeasureGenerateCodesId = "Generate job source codes for " //$NON-NLS-1$
|
||||
+ (jobInfo.getJobName() != null ? jobInfo.getJobName() : jobInfo.getJobId());
|
||||
TimeMeasure.step(timeMeasureGenerateCodesId, "Generated all source codes with children jobs (if have)");
|
||||
@@ -676,7 +695,7 @@ public class ProcessorUtilities {
|
||||
}
|
||||
TimeMeasure.step(timeMeasureGenerateCodesId, "Compile all source codes");
|
||||
processor.syntaxCheck();
|
||||
|
||||
|
||||
// TDI-36930, just after compile, need check the compile errors first.
|
||||
// only check current build
|
||||
if (isMainJob) {
|
||||
@@ -728,6 +747,7 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
processor.setContext(currentContext);
|
||||
|
||||
// main job will use stats / traces
|
||||
int option = TalendProcessOptionConstants.GENERATE_WITHOUT_FORMAT;
|
||||
if (isMain) {
|
||||
@@ -868,6 +888,14 @@ public class ProcessorUtilities {
|
||||
// processor.cleanBeforeGenerate(TalendProcessOptionConstants.CLEAN_JAVA_CODES
|
||||
// | TalendProcessOptionConstants.CLEAN_CONTEXTS | TalendProcessOptionConstants.CLEAN_DATA_SETS);
|
||||
jobInfo.setProcessor(processor);
|
||||
JobInfo parentJob = jobInfo.getFatherJobInfo();
|
||||
if (parentJob != null && (parentJob.getProcessor() != null)) {
|
||||
for (JobInfo subJob : parentJob.getProcessor().getBuildChildrenJobs()) {
|
||||
if (subJob.getJobId().equals(jobInfo.getJobId())) {
|
||||
subJob.setProcessor(processor);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!timerStarted) {
|
||||
idTimer = "generateCode for job: " + currentProcess.getName();
|
||||
TimeMeasure.begin(idTimer);
|
||||
@@ -908,28 +936,31 @@ public class ProcessorUtilities {
|
||||
Set<ModuleNeeded> neededLibraries = CorePlugin.getDefault().getDesignerCoreService()
|
||||
.getNeededLibrariesForProcess(currentProcess, false);
|
||||
if (neededLibraries != null) {
|
||||
Set<ModuleNeeded> adjustClassPath = new HashSet<ModuleNeeded>(neededLibraries);
|
||||
for (IClasspathAdjuster adjuster : classPathAdjusters) {
|
||||
adjuster.collectInfo(currentProcess, neededLibraries);
|
||||
adjustClassPath = adjuster.adjustClassPath(currentProcess, adjustClassPath);
|
||||
}
|
||||
|
||||
if (isNeedLoadmodules) {
|
||||
LastGenerationInfo.getInstance().setModulesNeededWithSubjobPerJob(jobInfo.getJobId(),
|
||||
jobInfo.getJobVersion(), adjustClassPath);
|
||||
}
|
||||
LastGenerationInfo.getInstance().setModulesNeededPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(),
|
||||
adjustClassPath);
|
||||
|
||||
LastGenerationInfo.getInstance().setModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(),
|
||||
neededLibraries);
|
||||
LastGenerationInfo.getInstance().setModulesNeededPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(), neededLibraries);
|
||||
// must install the needed libraries before generate codes with poms.
|
||||
CorePlugin.getDefault().getRunProcessService()
|
||||
.updateLibraries(adjustClassPath, currentProcess, retrievedJarsForCurrentBuild);
|
||||
CorePlugin.getDefault().getRunProcessService().updateLibraries(neededLibraries, currentProcess,
|
||||
retrievedJarsForCurrentBuild);
|
||||
|
||||
}
|
||||
resetRunJobComponentParameterForContextApply(jobInfo, currentProcess, selectedContextName);
|
||||
|
||||
generateNodeInfo(jobInfo, selectedContextName, statistics, needContext, option, progressMonitor, currentProcess);
|
||||
TimeMeasure.step(idTimer, "generateNodeInfo");
|
||||
|
||||
if (neededLibraries != null) {
|
||||
if (isNeedLoadmodules) {
|
||||
Set<ModuleNeeded> adjustClassPath = new HashSet<>(LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()));
|
||||
for (IClasspathAdjuster adjuster : classPathAdjusters) {
|
||||
adjuster.collectInfo(currentProcess, adjustClassPath);
|
||||
adjustClassPath = adjuster.adjustClassPath(currentProcess, adjustClassPath);
|
||||
}
|
||||
LastGenerationInfo.getInstance().setModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion(),
|
||||
adjustClassPath);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> argumentsMap = jobInfo.getArgumentsMap();
|
||||
if (argumentsMap != null) {
|
||||
processor.setArguments(argumentsMap);
|
||||
@@ -945,7 +976,7 @@ public class ProcessorUtilities {
|
||||
setNeededResources(argumentsMap, jobInfo);
|
||||
|
||||
processor.setArguments(argumentsMap);
|
||||
|
||||
|
||||
copyDQDroolsToSrc(selectedProcessItem);
|
||||
|
||||
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor, currentProcess,
|
||||
@@ -1011,8 +1042,8 @@ public class ProcessorUtilities {
|
||||
// maven command 'include-survivorship-rules' to export.
|
||||
// 2.TDQ-14308 current drools file in 'src/resourcesmetadata/survivorship/' should be included to job jar.
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
|
||||
ITDQItemService tdqItemService = (ITDQItemService) GlobalServiceRegister.getDefault().getService(
|
||||
ITDQItemService.class);
|
||||
ITDQItemService tdqItemService = (ITDQItemService) GlobalServiceRegister.getDefault()
|
||||
.getService(ITDQItemService.class);
|
||||
if (tdqItemService == null) {
|
||||
return;
|
||||
}
|
||||
@@ -1025,7 +1056,8 @@ public class ProcessorUtilities {
|
||||
final Iterator<String> relativepath = resouece.getRelativePathList().iterator();
|
||||
String pathStr = "metadata/survivorship"; //$NON-NLS-1$
|
||||
IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService();
|
||||
ITalendProcessJavaProject talendProcessJavaProject = runProcessService.getTalendJobJavaProject(processItem.getProperty());
|
||||
ITalendProcessJavaProject talendProcessJavaProject = runProcessService
|
||||
.getTalendJobJavaProject(processItem.getProperty());
|
||||
IFolder targetFolder = talendProcessJavaProject.getExternalResourcesFolder();
|
||||
if (targetFolder.exists()) {
|
||||
IFolder survFolder = targetFolder.getFolder(new Path(pathStr));
|
||||
@@ -1037,11 +1069,11 @@ public class ProcessorUtilities {
|
||||
String relativePath = relativepath.next();
|
||||
Set<URL> sources = resouece.getResourcesByRelativePath(relativePath);
|
||||
for (URL sourceUrl : sources) {
|
||||
File currentResource = new File(org.talend.commons.utils.io.FilesUtils.getFileRealPath(sourceUrl
|
||||
.getPath()));
|
||||
File currentResource = new File(
|
||||
org.talend.commons.utils.io.FilesUtils.getFileRealPath(sourceUrl.getPath()));
|
||||
if (currentResource.exists()) {
|
||||
FilesUtils.copyDirectory(currentResource, new File(targetFolder.getLocation().toPortableString()
|
||||
+ File.separator + pathStr));
|
||||
FilesUtils.copyDirectory(currentResource,
|
||||
new File(targetFolder.getLocation().toPortableString() + File.separator + pathStr));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1102,8 +1134,8 @@ public class ProcessorUtilities {
|
||||
// handle subjob in joblet. see bug 004937: tRunJob in a Joblet
|
||||
for (INode node : currentProcess.getGeneratingNodes()) {
|
||||
String componentName = node.getComponent().getName();
|
||||
if ((node != null) && (componentName.equals("tRunJob") || componentName.equals("cTalendJob") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|| "Routelets".equals(node.getComponent().getOriginalFamilyName()))) { //$NON-NLS-1$
|
||||
if ((node != null) && (componentName.equals("tRunJob") || componentName.equals("cTalendJob") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|| "Routelets".equals(node.getComponent().getOriginalFamilyName()))) { //$NON-NLS-1$
|
||||
// if the cTalendJob is configured by external Jar, then ignore it
|
||||
if ("cTalendJob".equals(componentName)) { //$NON-NLS-1$
|
||||
if ((Boolean) node.getElementParameter("FROM_EXTERNAL_JAR").getValue()) { //$NON-NLS-1$
|
||||
@@ -1232,18 +1264,16 @@ public class ProcessorUtilities {
|
||||
LastGenerationInfo generationInfo = LastGenerationInfo.getInstance();
|
||||
Set<ModuleNeeded> subjobModules = generationInfo.getModulesNeededWithSubjobPerJob(subJobInfo.getJobId(),
|
||||
subJobInfo.getJobVersion());
|
||||
generationInfo.getModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion())
|
||||
.addAll(subjobModules);
|
||||
generationInfo.getModulesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()).addAll(subjobModules);
|
||||
|
||||
Set<String> subjobRoutineModules = generationInfo.getRoutinesNeededWithSubjobPerJob(subJobInfo.getJobId(),
|
||||
subJobInfo.getJobVersion());
|
||||
generationInfo.getRoutinesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()).addAll(
|
||||
subjobRoutineModules);
|
||||
generationInfo.getRoutinesNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion())
|
||||
.addAll(subjobRoutineModules);
|
||||
|
||||
Set<String> subjobPigUDFModules = generationInfo.getPigudfNeededWithSubjobPerJob(subJobInfo.getJobId(),
|
||||
subJobInfo.getJobVersion());
|
||||
generationInfo.getPigudfNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()).addAll(
|
||||
subjobPigUDFModules);
|
||||
generationInfo.getPigudfNeededWithSubjobPerJob(jobInfo.getJobId(), jobInfo.getJobVersion()).addAll(subjobPigUDFModules);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1318,8 +1348,8 @@ public class ProcessorUtilities {
|
||||
* @param version null if no specific version required
|
||||
* @throws ProcessorException
|
||||
*/
|
||||
public static IProcessor generateCode(String processId, String contextName, String version, boolean statistics,
|
||||
boolean trace, boolean applyContextToChildren, IProgressMonitor... monitors) throws ProcessorException {
|
||||
public static IProcessor generateCode(String processId, String contextName, String version, boolean statistics, boolean trace,
|
||||
boolean applyContextToChildren, IProgressMonitor... monitors) throws ProcessorException {
|
||||
IProgressMonitor monitor = null;
|
||||
if (monitors == null) {
|
||||
monitor = new NullProgressMonitor();
|
||||
@@ -1373,8 +1403,8 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
JobInfo jobInfo = new JobInfo(process, contextName, version);
|
||||
jobInfo.setApplyContextToChildren(ProcessUtils.isOptionChecked(argumentsMap,
|
||||
TalendProcessArgumentConstant.ARG_ENABLE_APPLY_CONTEXT_TO_CHILDREN));
|
||||
jobInfo.setApplyContextToChildren(
|
||||
ProcessUtils.isOptionChecked(argumentsMap, TalendProcessArgumentConstant.ARG_ENABLE_APPLY_CONTEXT_TO_CHILDREN));
|
||||
jobInfo.setArgumentsMap(argumentsMap);
|
||||
|
||||
boolean statistics = ProcessUtils.isOptionChecked(argumentsMap, TalendProcessArgumentConstant.ARG_ENABLE_STATS);
|
||||
@@ -1502,7 +1532,7 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
CorePlugin.getDefault().getRunProcessService().buildCodesJavaProject(progressMonitor);
|
||||
|
||||
|
||||
// achen modify to fix 0006107
|
||||
ProcessItem pItem = null;
|
||||
|
||||
@@ -1583,20 +1613,20 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* jet code generator to get original classpath
|
||||
*/
|
||||
*
|
||||
* jet code generator to get original classpath
|
||||
*/
|
||||
public static String[] getCommandLine(String targetPlatform, boolean externalUse, String processId, String contextName,
|
||||
int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
return getCommandLine(targetPlatform, true, externalUse, processId, contextName, statisticPort, tracePort, codeOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* jet code generator to especially for tRunJob to get classpath with classpath.jar
|
||||
*/
|
||||
public static String[] getCommandLine(String targetPlatform, boolean skipClasspathJar, boolean externalUse, String processId, String contextName,
|
||||
int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
*
|
||||
* jet code generator to especially for tRunJob to get classpath with classpath.jar
|
||||
*/
|
||||
public static String[] getCommandLine(String targetPlatform, boolean skipClasspathJar, boolean externalUse, String processId,
|
||||
String contextName, int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
|
||||
IProcessor processor = findProcessorFromJobList(processId, contextName, null);
|
||||
if (processor != null && targetPlatform.equals(processor.getTargetPlatform())) {
|
||||
@@ -1620,8 +1650,8 @@ public class ProcessorUtilities {
|
||||
return new String[] {};
|
||||
}
|
||||
// because all jobs are based one new way, set the flag "oldBuildJob" to false.
|
||||
return getCommandLine(false, skipClasspathJar, targetPlatform, externalUse, process, selectedProcessItem.getProperty(), contextName, true,
|
||||
statisticPort, tracePort, codeOptions);
|
||||
return getCommandLine(false, skipClasspathJar, targetPlatform, externalUse, process, selectedProcessItem.getProperty(),
|
||||
contextName, true, statisticPort, tracePort, codeOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1641,9 +1671,8 @@ public class ProcessorUtilities {
|
||||
* @deprecated seems never use this one
|
||||
*/
|
||||
@Deprecated
|
||||
public static String[] getCommandLine(String targetPlatform, boolean externalUse, ProcessItem processItem,
|
||||
String contextName, boolean needContext, int statisticPort, int tracePort, String... codeOptions)
|
||||
throws ProcessorException {
|
||||
public static String[] getCommandLine(String targetPlatform, boolean externalUse, ProcessItem processItem, String contextName,
|
||||
boolean needContext, int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
IProcess currentProcess = null;
|
||||
IDesignerCoreService service = CorePlugin.getDefault().getDesignerCoreService();
|
||||
|
||||
@@ -1661,9 +1690,8 @@ public class ProcessorUtilities {
|
||||
* @deprecated seems never use this one
|
||||
*/
|
||||
@Deprecated
|
||||
public static String[] getCommandLine(String targetPlatform, boolean externalUse, IProcess currentProcess,
|
||||
String contextName, boolean needContext, int statisticPort, int tracePort, String... codeOptions)
|
||||
throws ProcessorException {
|
||||
public static String[] getCommandLine(String targetPlatform, boolean externalUse, IProcess currentProcess, String contextName,
|
||||
boolean needContext, int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
Property curProperty = null;
|
||||
if (currentProcess instanceof IProcess2) {
|
||||
curProperty = ((IProcess2) currentProcess).getProperty();
|
||||
@@ -1685,14 +1713,15 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static String[] getCommandLine(boolean oldBuildJob, String targetPlatform, boolean externalUse,
|
||||
IProcess currentProcess, Property property, String contextName, boolean needContext, int statisticPort,
|
||||
int tracePort, String... codeOptions) throws ProcessorException {
|
||||
return getCommandLine(oldBuildJob, false, targetPlatform, externalUse, currentProcess, property, contextName, needContext, statisticPort, tracePort, codeOptions);
|
||||
IProcess currentProcess, Property property, String contextName, boolean needContext, int statisticPort, int tracePort,
|
||||
String... codeOptions) throws ProcessorException {
|
||||
return getCommandLine(oldBuildJob, false, targetPlatform, externalUse, currentProcess, property, contextName, needContext,
|
||||
statisticPort, tracePort, codeOptions);
|
||||
}
|
||||
|
||||
public static String[] getCommandLine(boolean oldBuildJob, boolean skipClasspathJar, String targetPlatform, boolean externalUse,
|
||||
IProcess currentProcess, Property property, String contextName, boolean needContext, int statisticPort,
|
||||
int tracePort, String... codeOptions) throws ProcessorException {
|
||||
public static String[] getCommandLine(boolean oldBuildJob, boolean skipClasspathJar, String targetPlatform,
|
||||
boolean externalUse, IProcess currentProcess, Property property, String contextName, boolean needContext,
|
||||
int statisticPort, int tracePort, String... codeOptions) throws ProcessorException {
|
||||
if (currentProcess == null) {
|
||||
return new String[] {};
|
||||
}
|
||||
@@ -1707,10 +1736,10 @@ public class ProcessorUtilities {
|
||||
processor.setOldBuildJob(oldBuildJob);
|
||||
return processor.getCommandLine(needContext, externalUse, statisticPort, tracePort, codeOptions);
|
||||
}
|
||||
|
||||
public static String[] getCommandLine(boolean oldBuildJob, String targetPlatform, boolean externalUse,
|
||||
IProcessor processor, Property property, String contextName, boolean needContext, int statisticPort,
|
||||
int tracePort, String... codeOptions) throws ProcessorException {
|
||||
|
||||
public static String[] getCommandLine(boolean oldBuildJob, String targetPlatform, boolean externalUse, IProcessor processor,
|
||||
Property property, String contextName, boolean needContext, int statisticPort, int tracePort, String... codeOptions)
|
||||
throws ProcessorException {
|
||||
processor.setTargetPlatform(targetPlatform);
|
||||
processor.setOldBuildJob(oldBuildJob);
|
||||
return processor.getCommandLine(needContext, externalUse, statisticPort, tracePort, codeOptions);
|
||||
@@ -1817,11 +1846,14 @@ public class ProcessorUtilities {
|
||||
if ("tRunJob".equalsIgnoreCase(node.getComponentName()) || isCTalendJob || isRoutelet) { //$NON-NLS-1$
|
||||
|
||||
String jobIds = getParameterValue(node.getElementParameter(),
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS" : "PROCESS"+(isRoutelet?"_TYPE":"")+":PROCESS_TYPE_PROCESS"); //$NON-NLS-1$
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS" //$NON-NLS-1$
|
||||
: "PROCESS" + (isRoutelet ? "_TYPE" : "") + ":PROCESS_TYPE_PROCESS");
|
||||
String jobContext = getParameterValue(node.getElementParameter(),
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_CONTEXT" : "PROCESS"+(isRoutelet?"_TYPE":"")+":PROCESS_TYPE_CONTEXT"); //$NON-NLS-1$
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_CONTEXT" //$NON-NLS-1$
|
||||
: "PROCESS" + (isRoutelet ? "_TYPE" : "") + ":PROCESS_TYPE_CONTEXT");
|
||||
String jobVersion = getParameterValue(node.getElementParameter(),
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_VERSION" : "PROCESS"+(isRoutelet?"_TYPE":"")+":PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
isCTalendJob ? "SELECTED_JOB_NAME:PROCESS_TYPE_VERSION" //$NON-NLS-1$
|
||||
: "PROCESS" + (isRoutelet ? "_TYPE" : "") + ":PROCESS_TYPE_VERSION");
|
||||
// feature 19312
|
||||
String[] jobsArr = jobIds.split(ProcessorUtilities.COMMA);
|
||||
for (String jobId : jobsArr) {
|
||||
@@ -1840,8 +1872,8 @@ public class ProcessorUtilities {
|
||||
} else {
|
||||
// for joblet node
|
||||
if (PluginChecker.isJobLetPluginLoaded()) {
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(
|
||||
IJobletProviderService.class);
|
||||
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault()
|
||||
.getService(IJobletProviderService.class);
|
||||
if (service != null) {
|
||||
ProcessType jobletProcess = service.getJobletProcess(node);
|
||||
if (jobletProcess != null) {
|
||||
@@ -1875,13 +1907,13 @@ public class ProcessorUtilities {
|
||||
}
|
||||
return jobInfos;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isRouteletNode(NodeType node) {
|
||||
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
|
||||
String jobVersion = getParameterValue(node.getElementParameter(),"PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
|
||||
if(processItem != null) {
|
||||
return ERepositoryObjectType.getType(processItem.getProperty()).equals(ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
if (processItem != null) {
|
||||
return ERepositoryObjectType.getType(processItem.getProperty()).equals(ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1967,18 +1999,17 @@ public class ProcessorUtilities {
|
||||
|
||||
public static File getJavaProjectLibFolder() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
return processService.getJavaProjectLibFolder().getLocation().toFile();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String getJavaProjectLibFolderPath() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
|
||||
IRunProcessService.class);
|
||||
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
return processService.getJavaProjectLibFolder().getLocation().toPortableString();
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.edit</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip.editor</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.cwm.mip</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.datatools.xml</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.aether</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.tos</artifactId>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-maven-repository-build</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-components-dependencies</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-surefire-dependencies</artifactId>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-tcompv1-dependencies</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-maven-repository-unzip</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository-tos</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>studio-maven-repository-zip</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven.ui</artifactId>
|
||||
|
||||
@@ -6,4 +6,5 @@ FolderMavenSettingPage_CreatingMavenSettingErrorTitle=Error
|
||||
FolderMavenSettingPage_CreatingMavenSettingErrorMessage=Can\'t create the Maven setting files in this folder:
|
||||
ProjectPomProjectSettingPage_Titile=NOTE\: The modules and dependencies will be kept.
|
||||
ProjectPomProjectSettingPage_ConfirmTitle=Confirm
|
||||
ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project POM with modifications immediately.
|
||||
ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project POM with modifications immediately.
|
||||
AbstractPersistentProjectSettingPage.syncAllPoms=Do you want to update all poms? \n This operation might take long time depends on your project size.
|
||||
@@ -14,13 +14,26 @@ package org.talend.designer.maven.ui.setting.project.page;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.runtime.projectsetting.AbstractScriptProjectSettingPage;
|
||||
import org.talend.designer.maven.tools.AggregatorPomsHelper;
|
||||
import org.talend.designer.maven.ui.i18n.Messages;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbstractPersistentProjectSettingPage extends AbstractScriptProjectSettingPage {
|
||||
|
||||
private static boolean isUserIdentified;
|
||||
|
||||
public AbstractPersistentProjectSettingPage() {
|
||||
super();
|
||||
if (isUserIdentified) {
|
||||
isUserIdentified = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void load() throws IOException {
|
||||
// nothing to do
|
||||
}
|
||||
@@ -28,4 +41,24 @@ public abstract class AbstractPersistentProjectSettingPage extends AbstractScrip
|
||||
public void save() throws IOException {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
boolean ok = super.performOk();
|
||||
if (ok && getScriptTxt() != null && !getScriptTxt().isDisposed() && !isUserIdentified) {
|
||||
boolean generatePom = MessageDialog.openQuestion(getShell(), "Question", //$NON-NLS-1$
|
||||
Messages.getString("AbstractPersistentProjectSettingPage.syncAllPoms")); //$NON-NLS-1$
|
||||
isUserIdentified = true;
|
||||
if (generatePom) {
|
||||
try {
|
||||
new AggregatorPomsHelper().syncAllPoms();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,16 +12,43 @@
|
||||
// ============================================================================
|
||||
package org.talend.designer.maven.ui.setting.project.page;
|
||||
|
||||
import org.talend.core.runtime.projectsetting.EmptyProjectSettingPage;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.runtime.projectsetting.AbstractProjectSettingPage;
|
||||
import org.talend.designer.maven.tools.AggregatorPomsHelper;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
*/
|
||||
public class MavenProjectSettingPage extends EmptyProjectSettingPage {
|
||||
public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
|
||||
public MavenProjectSettingPage() {
|
||||
super();
|
||||
noDefaultAndApplyButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
Composite parent = getFieldEditorParent();
|
||||
parent.setLayout(new GridLayout());
|
||||
Button button = new Button(parent, SWT.NONE);
|
||||
button.setText("Synchronize all poms"); //$NON-NLS-1$
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
try {
|
||||
new AggregatorPomsHelper().syncAllPoms();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.designer.maven</artifactId>
|
||||
|
||||
@@ -167,7 +167,7 @@ public abstract class MavenCommandLauncher {
|
||||
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, RefreshUtil.MEMENTO_SELECTED_PROJECT);
|
||||
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_RECURSIVE, true);
|
||||
if (CommonsPlugin.isHeadless() && !CommonsPlugin.isESBMicorservice()) {
|
||||
workingCopy.setAttribute(MavenLaunchConstants.ATTR_OFFLINE, true);
|
||||
//workingCopy.setAttribute(MavenLaunchConstants.ATTR_OFFLINE, true);
|
||||
}
|
||||
|
||||
// seems no need refresh project, so won't set it.
|
||||
|
||||
@@ -157,7 +157,7 @@ class ForegroundResourceRefresher implements IDebugEventSetListener {
|
||||
|
||||
MavenRuntimeLaunchSupport.removeTempFiles(launch);
|
||||
|
||||
if (CommonsPlugin.isHeadless()) { // no used for commandline to refresh.
|
||||
if (CommonsPlugin.isHeadless() || !CommonsPlugin.isWorkbenchCreated()) { // no used for commandline to refresh.
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -19,6 +19,7 @@ public class TalendJavaProjectConstants {
|
||||
|
||||
public static final String DIR_POMS = "poms"; //$NON-NLS-1$
|
||||
|
||||
@Deprecated
|
||||
public static final String DIR_AGGREGATORS = "aggregators"; //$NON-NLS-1$
|
||||
|
||||
public static final String DIR_CODES = "code"; //$NON-NLS-1$
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.designer.maven.tools;
|
||||
import static org.talend.designer.maven.model.TalendJavaProjectConstants.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -27,6 +28,7 @@ import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
@@ -34,16 +36,23 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.ProjectReference;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ItemResourceUtil;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
@@ -81,16 +90,23 @@ public class AggregatorPomsHelper {
|
||||
this.projectTechName = projectTechName;
|
||||
}
|
||||
|
||||
public void createRootPom(IFolder folder, IProgressMonitor monitor) throws Exception {
|
||||
public void createRootPom(IFolder folder, List<String> modules, boolean force, IProgressMonitor monitor) throws Exception {
|
||||
IFile pomFile = folder.getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
if (!pomFile.exists()) {
|
||||
if (force || !pomFile.exists()) {
|
||||
Map<String, Object> parameters = new HashMap<String, Object>();
|
||||
parameters.put(MavenTemplateManager.KEY_PROJECT_NAME, projectTechName);
|
||||
Model model = MavenTemplateManager.getCodeProjectTemplateModel(parameters);
|
||||
if (modules != null && !modules.isEmpty()) {
|
||||
model.setModules(modules);
|
||||
}
|
||||
PomUtil.savePom(monitor, model, pomFile);
|
||||
}
|
||||
}
|
||||
|
||||
public void createRootPom(IFolder folder, IProgressMonitor monitor) throws Exception {
|
||||
createRootPom(folder, null, false, monitor);
|
||||
}
|
||||
|
||||
public void installRootPom(boolean current) throws Exception {
|
||||
IFile pomFile = getProjectPomsFolder().getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
installPom(pomFile, current);
|
||||
@@ -128,6 +144,7 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public IFolder getDeploymentsFolder() {
|
||||
return getProjectPomsFolder().getFolder(DIR_AGGREGATORS);
|
||||
}
|
||||
@@ -142,16 +159,20 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
|
||||
public static void updateCodeProjects(IProgressMonitor monitor) {
|
||||
updateCodeProjects(monitor, false);
|
||||
}
|
||||
|
||||
public static void updateCodeProjects(IProgressMonitor monitor, boolean forceBuild) {
|
||||
RepositoryWorkUnit workUnit = new RepositoryWorkUnit<Object>("update code project") { //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() {
|
||||
updateCodeProject(monitor, ERepositoryObjectType.ROUTINES);
|
||||
updateCodeProject(monitor, ERepositoryObjectType.ROUTINES, forceBuild);
|
||||
if (ProcessUtils.isRequiredPigUDFs(null)) {
|
||||
updateCodeProject(monitor, ERepositoryObjectType.PIG_UDF);
|
||||
updateCodeProject(monitor, ERepositoryObjectType.PIG_UDF, forceBuild);
|
||||
}
|
||||
if (ProcessUtils.isRequiredBeans(null)) {
|
||||
updateCodeProject(monitor, ERepositoryObjectType.valueOf("BEANS")); //$NON-NLS-1$
|
||||
updateCodeProject(monitor, ERepositoryObjectType.valueOf("BEANS"), forceBuild); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -159,11 +180,11 @@ public class AggregatorPomsHelper {
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
|
||||
}
|
||||
|
||||
private static void updateCodeProject(IProgressMonitor monitor, ERepositoryObjectType codeType) {
|
||||
private static void updateCodeProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean forceBuild) {
|
||||
try {
|
||||
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
|
||||
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
|
||||
buildAndInstallCodesProject(monitor, codeType);
|
||||
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -205,41 +226,50 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
|
||||
public static void buildAndInstallCodesProject(IProgressMonitor monitor, ERepositoryObjectType codeType) throws Exception {
|
||||
buildAndInstallCodesProject(monitor, codeType, true);
|
||||
buildAndInstallCodesProject(monitor, codeType, true, false);
|
||||
}
|
||||
|
||||
public static void buildAndInstallCodesProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean install)
|
||||
throws Exception {
|
||||
Job job = new Job("Install " + codeType.getLabel()) {
|
||||
public static void buildAndInstallCodesProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean install,
|
||||
boolean forceBuild) throws Exception {
|
||||
if (forceBuild || !BuildCacheManager.getInstance().isCodesBuild(codeType)) {
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
Job job = new Job("Install " + codeType.getLabel()) {
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
if (!BuildCacheManager.getInstance().isCodesBuild(codeType)) {
|
||||
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
|
||||
codeProject.buildModules(monitor, null, null);
|
||||
if (install) {
|
||||
Map<String, Object> argumentsMap = new HashMap<>();
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_GOAL, TalendMavenConstants.GOAL_INSTALL);
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, "-Dmaven.main.skip=true"); //$NON-NLS-1$
|
||||
codeProject.buildModules(monitor, null, argumentsMap);
|
||||
BuildCacheManager.getInstance().updateCodeLastBuildDate(codeType);
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
try {
|
||||
build(codeType, install, forceBuild, monitor);
|
||||
return org.eclipse.core.runtime.Status.OK_STATUS;
|
||||
} catch (Exception e) {
|
||||
return new org.eclipse.core.runtime.Status(IStatus.ERROR, DesignerMavenPlugin.PLUGIN_ID, 1,
|
||||
e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return org.eclipse.core.runtime.Status.OK_STATUS;
|
||||
} catch (Exception e) {
|
||||
return new org.eclipse.core.runtime.Status(IStatus.ERROR, DesignerMavenPlugin.PLUGIN_ID, 1, e.getMessage(),
|
||||
e);
|
||||
|
||||
};
|
||||
job.setUser(false);
|
||||
job.setPriority(Job.INTERACTIVE);
|
||||
job.schedule();
|
||||
} else {
|
||||
synchronized (codeType) {
|
||||
build(codeType, install, forceBuild, monitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
job.setUser(false);
|
||||
job.setPriority(Job.INTERACTIVE);
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
job.schedule();
|
||||
} else {
|
||||
job.join();
|
||||
private static void build(ERepositoryObjectType codeType, boolean install, boolean forceBuild, IProgressMonitor monitor)
|
||||
throws Exception {
|
||||
if (forceBuild || !BuildCacheManager.getInstance().isCodesBuild(codeType)) {
|
||||
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
|
||||
codeProject.buildModules(monitor, null, null);
|
||||
if (install) {
|
||||
Map<String, Object> argumentsMap = new HashMap<>();
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_GOAL, TalendMavenConstants.GOAL_INSTALL);
|
||||
argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, "-Dmaven.main.skip=true"); //$NON-NLS-1$
|
||||
codeProject.buildModules(monitor, null, argumentsMap);
|
||||
BuildCacheManager.getInstance().updateCodeLastBuildDate(codeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,14 +372,6 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
}
|
||||
if (parentPomFolder != null) {
|
||||
if (!parentPomFolder.exists()) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
runProcessService.initMavenJavaProject(new NullProgressMonitor(),
|
||||
ProjectManager.getInstance().getCurrentProject());
|
||||
}
|
||||
}
|
||||
try {
|
||||
for (IResource file : parentPomFolder.members()) {
|
||||
if (file.getName().equals(TalendMavenConstants.POM_FILE_NAME)) {
|
||||
@@ -455,4 +477,191 @@ public class AggregatorPomsHelper {
|
||||
jobProject.setUseTempPom(useTempPom);
|
||||
}
|
||||
|
||||
public void syncAllPoms() throws Exception {
|
||||
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("Synchronize all poms") { //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() {
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
List<IRepositoryViewObject> objects = null;
|
||||
if (runProcessService != null) {
|
||||
objects = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS);
|
||||
}
|
||||
BuildCacheManager.getInstance().clearCache();
|
||||
int size = 3 + (objects == null ? 0 : objects.size());
|
||||
monitor.setTaskName("Synchronize all poms"); //$NON-NLS-1$
|
||||
monitor.beginTask("", size); //$NON-NLS-1$
|
||||
// codes pom
|
||||
monitor.subTask("Synchronize code poms"); //$NON-NLS-1$
|
||||
updateCodeProjects(monitor, true);
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
// all jobs pom
|
||||
List<String> modules = new ArrayList<>();
|
||||
if (objects != null) {
|
||||
for (IRepositoryViewObject object : objects) {
|
||||
if (object.getProperty() != null && object.getProperty().getItem() != null
|
||||
&& object.getProperty().getItem() instanceof ProcessItem) {
|
||||
ProcessItem processItem = (ProcessItem) object.getProperty().getItem();
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(processItem)) {
|
||||
monitor.subTask("Synchronize job pom: " + processItem.getProperty().getLabel() //$NON-NLS-1$
|
||||
+ "_" + processItem.getProperty().getVersion()); //$NON-NLS-1$
|
||||
runProcessService.generateJobPom(processItem);
|
||||
ITalendProcessJavaProject jobProject = runProcessService
|
||||
.getTalendJobJavaProject(processItem.getProperty());
|
||||
modules.add(getModulePath(jobProject));
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// project pom
|
||||
monitor.subTask("Synchronize project pom"); //$NON-NLS-1$
|
||||
collectModules(modules);
|
||||
createRootPom(getProjectPomsFolder(), modules, true, monitor);
|
||||
monitor.worked(1);
|
||||
monitor.subTask("Install project pom"); //$NON-NLS-1$
|
||||
installRootPom(true);
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
monitor.done();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
// the update the project files need to be done in the workspace runnable to avoid
|
||||
// all
|
||||
// notification
|
||||
// of changes before the end of the modifications.
|
||||
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
workUnit.setAvoidUnloadResources(true);
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
|
||||
}
|
||||
};
|
||||
new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, true, runnableWithProgress);
|
||||
}
|
||||
|
||||
public void syncJobPoms(List<Item> jobItems) throws Exception {
|
||||
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||
RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("Synchronize job poms") { //$NON-NLS-1$
|
||||
|
||||
@Override
|
||||
protected void run() {
|
||||
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(final IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
monitor.setTaskName("Synchronize job poms"); //$NON-NLS-1$
|
||||
monitor.beginTask("", jobItems.size()); //$NON-NLS-1$
|
||||
IRunProcessService runProcessService = getRunProcessService();
|
||||
for (Item item : jobItems) {
|
||||
if (item instanceof ProcessItem) {
|
||||
ProcessItem processItem = (ProcessItem) item;
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(processItem)) {
|
||||
monitor.subTask("Synchronize job pom: " + processItem.getProperty().getLabel() //$NON-NLS-1$
|
||||
+ "_" + processItem.getProperty().getVersion()); //$NON-NLS-1$
|
||||
runProcessService.generateJobPom(processItem);
|
||||
}
|
||||
}
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
monitor.done();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
||||
try {
|
||||
ISchedulingRule schedulingRule = workspace.getRoot();
|
||||
// the update the project files need to be done in the workspace runnable to avoid
|
||||
// all
|
||||
// notification
|
||||
// of changes before the end of the modifications.
|
||||
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
workUnit.setAvoidUnloadResources(true);
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
|
||||
}
|
||||
};
|
||||
new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, true, runnableWithProgress);
|
||||
}
|
||||
|
||||
private String getModulePath(ITalendProcessJavaProject project) {
|
||||
IFile pomFile = project.getProjectPom();
|
||||
IFile parentPom = getProjectPomsFolder().getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
if (parentPom != null) {
|
||||
IPath relativePath = pomFile.getParent().getLocation().makeRelativeTo(parentPom.getParent().getLocation());
|
||||
return relativePath.toPortableString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void collectModules(List<String> modules) {
|
||||
IRunProcessService service = getRunProcessService();
|
||||
if (service != null) {
|
||||
modules.add(getModulePath(service.getTalendCodeJavaProject(ERepositoryObjectType.ROUTINES)));
|
||||
if (ProcessUtils.isRequiredPigUDFs(null)) {
|
||||
modules.add(getModulePath(service.getTalendCodeJavaProject(ERepositoryObjectType.PIG_UDF)));
|
||||
}
|
||||
if (ProcessUtils.isRequiredBeans(null)) {
|
||||
modules.add(getModulePath(service.getTalendCodeJavaProject(ERepositoryObjectType.valueOf("BEANS")))); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
List<ProjectReference> references = ProjectManager.getInstance().getCurrentProject().getProjectReferenceList(true);
|
||||
for (ProjectReference reference : references) {
|
||||
String refProjectTechName = reference.getReferencedProject().getTechnicalLabel();
|
||||
String modulePath = "../../" + refProjectTechName + "/" + TalendJavaProjectConstants.DIR_POMS; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
modules.add(modulePath);
|
||||
}
|
||||
}
|
||||
|
||||
private static IRunProcessService getRunProcessService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
return runProcessService;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -216,6 +216,15 @@ public class BuildCacheManager {
|
||||
codesLastBuildCache.put(codeType, cacheLastChangeDate);
|
||||
}
|
||||
|
||||
public void clearCache(ERepositoryObjectType codeType) {
|
||||
codesLastBuildCache.remove(codeType);
|
||||
}
|
||||
|
||||
public void clearCache() {
|
||||
cache.clear();
|
||||
codesLastBuildCache.clear();
|
||||
}
|
||||
|
||||
public boolean isCodesBuild(ERepositoryObjectType codeType) {
|
||||
Date lastBuildDate = codesLastBuildCache.get(codeType);
|
||||
if (lastBuildDate == null) {
|
||||
|
||||
@@ -126,20 +126,23 @@ public class MavenPomSynchronizer {
|
||||
IFile psFile = templateFolder.getFile(IProjectSettingTemplateConstants.JOB_RUN_PS_TEMPLATE_FILE_NAME);
|
||||
IFile infoFile = templateFolder.getFile(IProjectSettingTemplateConstants.JOB_INFO_TEMPLATE_FILE_NAME);
|
||||
|
||||
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(codeProject.getPropery());
|
||||
String shContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH,
|
||||
templateParameters);
|
||||
String batContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT,
|
||||
templateParameters);
|
||||
String psContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS,
|
||||
templateParameters);
|
||||
String jobInfoContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_JOB_INFO,
|
||||
templateParameters);
|
||||
|
||||
MavenTemplateManager.saveContent(shFile, shContent, overwrite);
|
||||
MavenTemplateManager.saveContent(batFile, batContent, overwrite);
|
||||
MavenTemplateManager.saveContent(psFile, psContent, overwrite);
|
||||
MavenTemplateManager.saveContent(infoFile, jobInfoContent, overwrite);
|
||||
Property property = codeProject.getPropery();
|
||||
if (property != null) {
|
||||
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(property);
|
||||
String shContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_SH,
|
||||
templateParameters);
|
||||
String batContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_BAT,
|
||||
templateParameters);
|
||||
String psContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_PS,
|
||||
templateParameters);
|
||||
String jobInfoContent = MavenTemplateManager.getProjectSettingValue(IProjectSettingPreferenceConstants.TEMPLATE_JOB_INFO,
|
||||
templateParameters);
|
||||
|
||||
MavenTemplateManager.saveContent(shFile, shContent, overwrite);
|
||||
MavenTemplateManager.saveContent(batFile, batContent, overwrite);
|
||||
MavenTemplateManager.saveContent(psFile, psContent, overwrite);
|
||||
MavenTemplateManager.saveContent(infoFile, jobInfoContent, overwrite);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,11 @@ import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
@@ -54,11 +58,18 @@ public class ProcessorDependenciesManager {
|
||||
try {
|
||||
List neededDependencies = new ArrayList<Dependency>();
|
||||
Set<ModuleNeeded> neededLibraries = getAllModuleNeededWithTestCase();
|
||||
Set<String> uniquDependenciesSet = new HashSet<>();
|
||||
|
||||
for (ModuleNeeded module : neededLibraries) {
|
||||
Dependency dependency = null;
|
||||
// if (module.getDeployStatus() == ELibraryInstallStatus.DEPLOYED) {
|
||||
// }
|
||||
dependency = PomUtil.createModuleDependency(module.getMavenUri());
|
||||
final String mavenUri = module.getMavenUri();
|
||||
if (uniquDependenciesSet.contains(mavenUri)) {
|
||||
continue; // must be same GAV, avoid the different other attrs for modules
|
||||
}
|
||||
uniquDependenciesSet.add(mavenUri);
|
||||
dependency = PomUtil.createModuleDependency(mavenUri);
|
||||
if (dependency != null) {
|
||||
if (module.isExcludeDependencies()) {
|
||||
Exclusion exclusion = new Exclusion();
|
||||
@@ -71,8 +82,13 @@ public class ProcessorDependenciesManager {
|
||||
}
|
||||
|
||||
java.util.Collections.sort(neededDependencies);
|
||||
|
||||
return updateDependencies(progressMonitor, model, neededDependencies, false);
|
||||
boolean fresh = false;
|
||||
if (processor.getProperty() != null && processor.getProperty().getItem() != null
|
||||
&& processor.getProcess() instanceof IProcess2) {
|
||||
// is standard job.
|
||||
fresh = true;
|
||||
}
|
||||
return updateDependencies(progressMonitor, model, neededDependencies, fresh);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new ProcessorException(e);
|
||||
@@ -147,7 +163,7 @@ public class ProcessorDependenciesManager {
|
||||
|
||||
private Set<ModuleNeeded> getAllModuleNeededWithTestCase() throws PersistenceException {
|
||||
// add the job modules.
|
||||
Set<ModuleNeeded> neededLibraries;
|
||||
Set<ModuleNeeded> neededLibraries = new HashSet<>();
|
||||
boolean hasTestCase = false;
|
||||
List<ProcessItem> testContainers = null;
|
||||
ProcessItem item = null;
|
||||
@@ -169,20 +185,19 @@ public class ProcessorDependenciesManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
neededLibraries.addAll(processor.getNeededModules(false));
|
||||
if (hasTestCase) {
|
||||
neededLibraries = new HashSet<>();
|
||||
IProcess jobProcess = getDesignerCoreService().getProcessFromProcessItem(item);
|
||||
neededLibraries.addAll(jobProcess.getNeededModules(false));
|
||||
for (ProcessItem testcaseItem : testContainers) {
|
||||
IProcess testcaseProcess = getDesignerCoreService().getProcessFromProcessItem(testcaseItem);
|
||||
neededLibraries.addAll(testcaseProcess.getNeededModules(false));
|
||||
if (testContainers != null) {
|
||||
for (ProcessItem testcaseItem : testContainers) {
|
||||
IProcess testcaseProcess = getDesignerCoreService().getProcessFromProcessItem(testcaseItem);
|
||||
neededLibraries.addAll(testcaseProcess.getNeededModules(false));
|
||||
}
|
||||
}
|
||||
if(GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
|
||||
ILibraryManagerService repositoryBundleService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
|
||||
repositoryBundleService.installModules(neededLibraries, null);
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
|
||||
ILibraryManagerService repositoryBundleService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
|
||||
.getService(ILibraryManagerService.class);
|
||||
repositoryBundleService.installModules(neededLibraries, null);
|
||||
}
|
||||
} else {
|
||||
neededLibraries = processor.getNeededModules();
|
||||
}
|
||||
return neededLibraries;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
package org.talend.designer.maven.tools.creator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -71,14 +72,24 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
|
||||
protected void addDependencies(Model model) {
|
||||
Set<ModuleNeeded> runningModules = getDependenciesModules();
|
||||
if (runningModules != null) {
|
||||
Set<ModuleNeeded> needModules = new HashSet<ModuleNeeded>();
|
||||
Set<String> uniquDependenciesSet = new HashSet<String>();
|
||||
for (ModuleNeeded module : runningModules) {
|
||||
final String mavenUri = module.getMavenUri();
|
||||
if (uniquDependenciesSet.contains(mavenUri)) {
|
||||
continue;
|
||||
}
|
||||
uniquDependenciesSet.add(mavenUri);
|
||||
needModules.add(module);
|
||||
}
|
||||
if (needModules != null) {
|
||||
List<Dependency> existedDependencies = model.getDependencies();
|
||||
if (existedDependencies == null) {
|
||||
existedDependencies = new ArrayList<Dependency>();
|
||||
model.setDependencies(existedDependencies);
|
||||
}
|
||||
|
||||
for (ModuleNeeded module : runningModules) {
|
||||
for (ModuleNeeded module : needModules) {
|
||||
Dependency dependency = null;
|
||||
// TDI-37032 add dependency only if jar avialable in maven
|
||||
if (module.getDeployStatus() == ELibraryInstallStatus.DEPLOYED) {
|
||||
|
||||
@@ -17,13 +17,11 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -42,6 +40,7 @@ import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
@@ -52,7 +51,9 @@ import org.talend.core.model.properties.Project;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.SVNConstant;
|
||||
import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.runtime.process.JobInfoProperties;
|
||||
import org.talend.core.runtime.process.LastGenerationInfo;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
@@ -90,9 +91,9 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
public String getWindowsClasspath() {
|
||||
return this.windowsClasspath;
|
||||
}
|
||||
|
||||
|
||||
public String getWindowsClasspathForPs1() {
|
||||
return "\'" + getWindowsClasspath() + "\'";
|
||||
return "\'" + getWindowsClasspath() + "\'";
|
||||
}
|
||||
|
||||
public void setWindowsClasspath(String windowsClasspath) {
|
||||
@@ -374,7 +375,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
checkPomProperty(properties, "talend.job.sh.addition", ETalendMavenVariables.JobShAddition,
|
||||
unixScriptAdditionValue.toString());
|
||||
|
||||
checkPomProperty(properties, "talend.job.ps1.classpath", ETalendMavenVariables.JobBatClasspath, getWindowsClasspathForPs1());
|
||||
checkPomProperty(properties, "talend.job.ps1.classpath", ETalendMavenVariables.JobBatClasspath,
|
||||
getWindowsClasspathForPs1());
|
||||
|
||||
String finalNameStr = JavaResourcesHelper.getJobJarName(property.getLabel(), property.getVersion());
|
||||
checkPomProperty(properties, "talend.job.finalName", ETalendMavenVariables.JobFinalName, finalNameStr);
|
||||
@@ -559,7 +561,8 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
String content = MavenTemplateManager.getTemplateContent(templateFile,
|
||||
IProjectSettingPreferenceConstants.TEMPLATE_STANDALONE_JOB_ASSEMBLY, JOB_TEMPLATE_BUNDLE,
|
||||
IProjectSettingTemplateConstants.PATH_STANDALONE + '/'
|
||||
+ IProjectSettingTemplateConstants.ASSEMBLY_JOB_TEMPLATE_FILE_NAME, templateParameters);
|
||||
+ IProjectSettingTemplateConstants.ASSEMBLY_JOB_TEMPLATE_FILE_NAME,
|
||||
templateParameters);
|
||||
if (content != null) {
|
||||
ByteArrayInputStream source = new ByteArrayInputStream(content.getBytes());
|
||||
if (assemblyFile.exists()) {
|
||||
@@ -586,7 +589,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
StringBuilder talendlibIncludes = new StringBuilder();
|
||||
StringBuilder _3rdPartylibExcludes = new StringBuilder();
|
||||
StringBuilder jobIncludes = new StringBuilder();
|
||||
|
||||
|
||||
// add children jobs
|
||||
Set<JobInfo> childrenJobInfo = getJobProcessor().getBuildChildrenJobs();
|
||||
Set<String> childrenCoordinate = new HashSet<>();
|
||||
@@ -603,11 +606,14 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
String parentCoordinate = PomIdsHelper.getJobGroupId(parentProperty) + ":" //$NON-NLS-1$
|
||||
+ PomIdsHelper.getJobArtifactId(parentProperty);
|
||||
addItem(jobIncludes, parentCoordinate, SEPARATOR);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
Model model = MavenPlugin.getMavenModelManager().readMavenModel(getPomFile());
|
||||
List<Dependency> dependencies = model.getDependencies();
|
||||
|
||||
Set<ModuleNeeded> fullModulesList = LastGenerationInfo.getInstance()
|
||||
.getModulesNeededWithSubjobPerJob(parentProperty.getId(), parentProperty.getVersion());
|
||||
|
||||
// add talend libraries and codes
|
||||
Set<String> talendLibCoordinate = new HashSet<>();
|
||||
String projectGroupId = PomIdsHelper.getProjectGroupId();
|
||||
@@ -615,26 +621,43 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
String dependencyGroupId = dependency.getGroupId();
|
||||
String coordinate = dependencyGroupId + ":" + dependency.getArtifactId(); //$NON-NLS-1$
|
||||
if (!childrenCoordinate.contains(coordinate)) {
|
||||
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(dependencyGroupId) || dependencyGroupId.startsWith(projectGroupId)) {
|
||||
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(dependencyGroupId)
|
||||
|| dependencyGroupId.startsWith(projectGroupId)) {
|
||||
addItem(talendlibIncludes, coordinate, SEPARATOR);
|
||||
talendLibCoordinate.add(coordinate);
|
||||
}
|
||||
}
|
||||
}
|
||||
// add 3rd party libraries
|
||||
Set<String> _3rdDepLib = new HashSet<>();
|
||||
for (Dependency dependency : dependencies) {
|
||||
String coordinate = dependency.getGroupId() + ":" + dependency.getArtifactId(); //$NON-NLS-1$
|
||||
if (!childrenCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate)) {
|
||||
_3rdDepLib.add(coordinate);
|
||||
addItem(_3rdPartylibExcludes, coordinate, SEPARATOR);
|
||||
}
|
||||
}
|
||||
if (_3rdPartylibExcludes.length() == 0) {
|
||||
addItem(_3rdPartylibExcludes, "null:null", SEPARATOR); //$NON-NLS-1$
|
||||
// add missing modules from the job generation of childrens
|
||||
for (ModuleNeeded moduleNeeded : fullModulesList) {
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(moduleNeeded.getMavenUri());
|
||||
String coordinate = artifact.getGroupId() + ":" + artifact.getArtifactId(); //$NON-NLS-1$
|
||||
if (!childrenCoordinate.contains(coordinate) && !talendLibCoordinate.contains(coordinate) && !_3rdDepLib.contains(coordinate)) {
|
||||
if (MavenConstants.DEFAULT_LIB_GROUP_ID.equals(artifact.getGroupId())
|
||||
|| artifact.getGroupId().startsWith(projectGroupId)) {
|
||||
addItem(talendlibIncludes, coordinate, SEPARATOR);
|
||||
} else {
|
||||
addItem(_3rdPartylibExcludes, coordinate, SEPARATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_3rdPartylibExcludes.length() == 0) {
|
||||
// if removed, it might add many unwanted dependencies to the libs folder. (or we should simply remove the full empty block of dependencySet)
|
||||
addItem(_3rdPartylibExcludes, "null:null", SEPARATOR); //$NON-NLS-1$
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
|
||||
String talendLibIncludesStr = StringUtils.removeEnd(talendlibIncludes.toString(), SEPARATOR);
|
||||
String _3rdPartylibExcludesStr = StringUtils.removeEnd(_3rdPartylibExcludes.toString(), SEPARATOR);
|
||||
String jobIncludesStr = StringUtils.removeEnd(jobIncludes.toString(), SEPARATOR);
|
||||
@@ -645,7 +668,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
|
||||
private void addItem(StringBuilder builder, String coordinate, String separator) {
|
||||
if(builder.length() > 0) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append("\t\t\t\t"); //$NON-NLS-1$
|
||||
}
|
||||
builder.append("<include>"); //$NON-NLS-1$
|
||||
|
||||
@@ -149,10 +149,10 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
}
|
||||
|
||||
final Map<String, Object> templateParameters = PomUtil.getTemplateParameters(getJobProcessor());
|
||||
String content = MavenTemplateManager.getTemplateContent(templateFile,
|
||||
IProjectSettingPreferenceConstants.TEMPLATE_ROUTE_ASSEMBLY, JOB_TEMPLATE_BUNDLE,
|
||||
String content = MavenTemplateManager.getTemplateContent(templateFile, null, JOB_TEMPLATE_BUNDLE,
|
||||
IProjectSettingTemplateConstants.PATH_OSGI_BUNDLE + '/'
|
||||
+ IProjectSettingTemplateConstants.ASSEMBLY_JOB_TEMPLATE_FILE_NAME, templateParameters);
|
||||
+ IProjectSettingTemplateConstants.ASSEMBLY_JOB_TEMPLATE_FILE_NAME,
|
||||
templateParameters);
|
||||
if (content != null) {
|
||||
ByteArrayInputStream source = new ByteArrayInputStream(content.getBytes());
|
||||
if (assemblyFile.exists()) {
|
||||
@@ -160,6 +160,7 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
} else {
|
||||
assemblyFile.create(source, true, monitor);
|
||||
}
|
||||
updateDependencySet(assemblyFile);
|
||||
set = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Set;
|
||||
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
@@ -112,10 +113,12 @@ public class MavenProjectUtils {
|
||||
ClasspathAttribute attribute = new ClasspathAttribute("maven.pomderived", Boolean.TRUE.toString());
|
||||
for (ProjectSystemFolder psf : MavenSystemFolders.ALL_DIRS) {
|
||||
IFolder resources = p.getFolder(psf.getPath());
|
||||
IFolder output = p.getFolder(psf.getOutputPath());
|
||||
IClasspathEntry newEntry = JavaCore.newSourceEntry(resources.getFullPath(), new IPath[0], new IPath[0],
|
||||
output.getFullPath(), new IClasspathAttribute[] { attribute });
|
||||
list.add(newEntry);
|
||||
if (resources.exists()) { // add the condition mostly for routines, since the resources folder might not exist
|
||||
IFolder output = p.getFolder(psf.getOutputPath());
|
||||
IClasspathEntry newEntry = JavaCore.newSourceEntry(resources.getFullPath(), new IPath[0], new IPath[0],
|
||||
output.getFullPath(), new IClasspathAttribute[] { attribute });
|
||||
list.add(newEntry);
|
||||
}
|
||||
}
|
||||
IPath defaultJREContainerPath = JavaRuntime.newDefaultJREContainerPath();
|
||||
|
||||
@@ -127,7 +130,7 @@ public class MavenProjectUtils {
|
||||
newEntry.getAccessRules(), new IClasspathAttribute[] { attribute }, newEntry.isExported());
|
||||
list.add(newEntry);
|
||||
|
||||
if (!Arrays.equals(rawClasspathEntries, list.toArray(new IClasspathEntry[] {}))) {
|
||||
if (!Arrays.equals(rawClasspathEntries, list.toArray(new IClasspathEntry[] {})) || !p.getFile(".classpath").exists()) {
|
||||
rawClasspathEntries = list.toArray(new IClasspathEntry[] {});
|
||||
javaProject.setRawClasspath(rawClasspathEntries, monitor);
|
||||
javaProject.setOutputLocation(p.getFolder(MavenSystemFolders.JAVA.getOutputPath()).getFullPath(), monitor);
|
||||
|
||||
@@ -18,6 +18,8 @@ import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.talend.commons.utils.VersionUtils;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.properties.Property;
|
||||
@@ -115,6 +117,14 @@ public class PomIdsHelper {
|
||||
return JavaResourcesHelper.getGroupName(TalendMavenConstants.DEFAULT_JOB);
|
||||
}
|
||||
|
||||
private static String getDefaultgroupIdSuffix(Property property) {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
return service.getDefaultGroupIdSuffix(property);
|
||||
}
|
||||
return TalendMavenConstants.DEFAULT_JOB;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return "org.talend.job.<projectName>".
|
||||
*/
|
||||
@@ -127,7 +137,7 @@ public class PomIdsHelper {
|
||||
}
|
||||
}
|
||||
String projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
return getGroupId(projectTechName, TalendMavenConstants.DEFAULT_JOB, property);
|
||||
return getGroupId(projectTechName, getDefaultgroupIdSuffix(property), property);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -211,7 +221,13 @@ public class PomIdsHelper {
|
||||
if (baseName == null && property == null) {
|
||||
return groupId;
|
||||
}
|
||||
//codes, job
|
||||
// codes
|
||||
if (baseName.equals(TalendMavenConstants.DEFAULT_CODE) || baseName.equals(TalendMavenConstants.DEFAULT_PIGUDF)
|
||||
|| baseName.equals(TalendMavenConstants.DEFAULT_BEAN)) {
|
||||
groupId += "." + baseName; //$NON-NLS-1$
|
||||
return groupId;
|
||||
}
|
||||
// only for job
|
||||
boolean appendFolderName = manager.getBoolean(MavenConstants.APPEND_FOLDER_TO_GROUPID);
|
||||
if (!appendFolderName) {
|
||||
if (baseName != null) {
|
||||
@@ -219,9 +235,8 @@ public class PomIdsHelper {
|
||||
}
|
||||
return groupId;
|
||||
}
|
||||
// only for job
|
||||
if (property != null) {
|
||||
String suffix = getJobFolderSuffix(property); //$NON-NLS-1$
|
||||
String suffix = getJobFolderSuffix(property); // $NON-NLS-1$
|
||||
if (!StringUtils.isEmpty(suffix)) {
|
||||
groupId += "." + suffix; //$NON-NLS-1$
|
||||
}
|
||||
@@ -232,7 +247,7 @@ public class PomIdsHelper {
|
||||
private static String getJobFolderSuffix(Property property) {
|
||||
String suffix = ItemResourceUtil.getItemRelativePath(property).toPortableString();
|
||||
suffix = StringUtils.strip(suffix, "/"); //$NON-NLS-1$
|
||||
suffix = StringUtils.replace(suffix, "/", "."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
suffix = StringUtils.replace(suffix, "/", "."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return suffix;
|
||||
}
|
||||
|
||||
@@ -255,7 +270,7 @@ public class PomIdsHelper {
|
||||
IPreferenceStore preferenceStore = preferenceManager.getPreferenceStore();
|
||||
if (StringUtils.isEmpty(preferenceStore.getDefaultString(MavenConstants.PROJECT_GROUPID))
|
||||
&& StringUtils.isEmpty(preferenceStore.getString(MavenConstants.PROJECT_GROUPID))) {
|
||||
preferenceStore.setDefault(MavenConstants.PROJECT_GROUPID, getDefaultProjetGroupId(projectTechName));
|
||||
preferenceStore.setValue(MavenConstants.PROJECT_GROUPID, getDefaultProjetGroupId(projectTechName));
|
||||
preferenceManager.save();
|
||||
}
|
||||
preferenceManagers.put(projectTechName, preferenceManager);
|
||||
|
||||
@@ -51,10 +51,17 @@ import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceRuleFactory;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.core.runtime.jobs.MultiRule;
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.eclipse.m2e.core.embedder.MavenModelManager;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
@@ -301,6 +308,7 @@ public class PomUtil {
|
||||
* According to the process, generate the groud id, like org.talend.process.di.demo.
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static String generateGroupId(final IProcessor jProcessor) {
|
||||
final Property property = jProcessor.getProperty();
|
||||
final IProcess process = jProcessor.getProcess();
|
||||
@@ -801,54 +809,99 @@ public class PomUtil {
|
||||
}
|
||||
|
||||
public static void backupPomFile(ITalendProcessJavaProject talendProject) {
|
||||
IProject project = talendProject.getProject();
|
||||
IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
|
||||
IFile pomFile = project.getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
final IProject project = talendProject.getProject();
|
||||
final IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
|
||||
final IFile pomFile = project.getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
backFile.delete(true, false, null);
|
||||
}
|
||||
pomFile.copy(backFile.getFullPath(), true, null);
|
||||
} catch (CoreException e) {
|
||||
updateFilesInWorkspaceRunnable(null, new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
backFile.delete(true, false, null);
|
||||
}
|
||||
pomFile.copy(backFile.getFullPath(), true, null);
|
||||
} catch (CoreException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}, backFile, pomFile);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void restorePomFile(ITalendProcessJavaProject talendProject) {
|
||||
IProject project = talendProject.getProject();
|
||||
IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
|
||||
IFile pomFile = project.getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
boolean isChanged = false;
|
||||
final IProject project = talendProject.getProject();
|
||||
final IFile backFile = project.getFile(TalendMavenConstants.POM_BACKUP_FILE_NAME);
|
||||
final IFile pomFile = project.getFile(TalendMavenConstants.POM_FILE_NAME);
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
if (pomFile.exists()) {
|
||||
isChanged = !IOUtils.contentEquals(backFile.getContents(), pomFile.getContents());
|
||||
if (isChanged) {
|
||||
pomFile.delete(true, false, null);
|
||||
updateFilesInWorkspaceRunnable(null, new IWorkspaceRunnable() {
|
||||
|
||||
@Override
|
||||
public void run(IProgressMonitor monitor) throws CoreException {
|
||||
boolean isChanged = false;
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
if (pomFile.exists()) {
|
||||
isChanged = !IOUtils.contentEquals(backFile.getContents(), pomFile.getContents());
|
||||
if (isChanged) {
|
||||
pomFile.delete(true, false, null);
|
||||
}
|
||||
} else {
|
||||
isChanged = true;
|
||||
}
|
||||
if (isChanged) {
|
||||
backFile.copy(pomFile.getFullPath(), true, null);
|
||||
}
|
||||
}
|
||||
} catch (CoreException | IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
backFile.delete(true, false, null);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
System.gc();
|
||||
try {
|
||||
backFile.delete(true, false, null);
|
||||
} catch (CoreException e1) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isChanged = true;
|
||||
}
|
||||
if (isChanged) {
|
||||
backFile.copy(pomFile.getFullPath(), true, null);
|
||||
}, pomFile, backFile);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void updateFilesInWorkspaceRunnable(IProgressMonitor monitor, IWorkspaceRunnable runnable,
|
||||
IResource... resources) throws Exception {
|
||||
ISchedulingRule rule = null;
|
||||
if (resources != null && 0 < resources.length) {
|
||||
IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
|
||||
List<ISchedulingRule> resourceRules = new ArrayList<>();
|
||||
for (IResource resource : resources) {
|
||||
if (resource != null) {
|
||||
// use refresh rule instead of modify rule
|
||||
ISchedulingRule modifyRule = ruleFactory.refreshRule(resource);
|
||||
if (modifyRule != null) {
|
||||
resourceRules.add(modifyRule);
|
||||
} else {
|
||||
resourceRules.add(resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (CoreException | IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
} finally {
|
||||
try {
|
||||
if (backFile.exists()) {
|
||||
backFile.delete(true, false, null);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
System.gc();
|
||||
try {
|
||||
backFile.delete(true, false, null);
|
||||
} catch (CoreException e1) {
|
||||
//
|
||||
}
|
||||
if (!resourceRules.isEmpty()) {
|
||||
rule = new MultiRule(resourceRules.toArray(new ISchedulingRule[0]));
|
||||
}
|
||||
}
|
||||
ResourcesPlugin.getWorkspace().run(runnable, rule, IWorkspace.AVOID_UPDATE, monitor);
|
||||
}
|
||||
|
||||
public static void cleanLastUpdatedFile(final File file) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.developpement</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.helpers</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.axis2</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.batik</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>tcommon-studio-se</artifactId>
|
||||
<version>7.0.1-SNAPSHOT</version>
|
||||
<version>7.0.1-EP2</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.apache.cassandra</artifactId>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user