Compare commits

...

33 Commits

Author SHA1 Message Date
Mike Yan
800fae8bd9 TESB-21510: Fixed to use osgi assembly to build job as OSGi type 2018-03-13 15:22:43 +08:00
Denis Sergent
2b181edd45 TESB-21282 Use appropriate suffix for route & service default group id (#1507) 2018-03-12 13:08:10 +01:00
apoltavtsev
8387c608eb TESB-21427 Caching of subjob processor is removed (#1511) 2018-03-12 09:45:19 +01:00
zwxue
2992c46dda fix(TUP-19764):After change the maven setting value in project (#1506)
setting-maven, it can not work for new created jobs.
2018-03-09 20:06:08 +08:00
Vladimir Bogatyrov
4c7095f33d Commandline route buiid temporary "offline" fix (#1505) 2018-03-09 12:42:49 +01:00
nrousseau
dbb2a897a7 fix(TUP-19763) fix problem of build of routines (#1501) 2018-03-09 15:53:38 +08:00
Chao MENG
7183fed038 fix(TUP-19408): Pom file is deteled in server incorrectly. (#1497)
https://jira.talendforge.org/browse/TUP-19408
2018-03-09 11:12:04 +08:00
Jane Ding
b524d1e492 fix(TUP-19708)Cann't run mapreduce job when run it on HDI36 (#1499) 2018-03-08 21:05:59 +08:00
zwxue
3c501a0a40 fix(TUP-19679):routines with wrong groupId (#1498) 2018-03-08 19:02:28 +08:00
zwxue
45fc1fea8b fix(TUP-19544):When log on git project after migration, there are a lot (#1496)
of error logs for lack of pom.xml
2018-03-08 19:01:57 +08:00
zwxue
383c0e4a4a fix(TUP-19695): update code change. (#1490) 2018-03-08 15:23:50 +08:00
Jane Ding
474eae8f29 fix(TUP-19695)run task failed with error :Error: Could not find or load (#1489)
main class commonpro.tjava_0_1.tjava
https://jira.talendforge.org/browse/TUP-19695
2018-03-08 15:23:30 +08:00
zwxue
445b472cdb fix(TUP-19452):Add sync all poms function. (#1484) 2018-03-08 15:20:46 +08:00
apoltavtsev
4dc429d0ea TESB-20833 Maven "offline" state tool is added (#1485) 2018-03-06 18:16:20 +01:00
nrousseau
757472a9fa fix launch of studio (found from junit) 2018-03-06 12:56:58 +08:00
apoltavtsev
13be127b12 TESB-21435 Default Route dependencies are added (#1479)
* TESB-21435 Default Route dependencies are added

* TESB-21435 Default Route dependencies are added

* TESB-21435 Minor style corrections
2018-03-05 10:21:21 +01:00
nrousseau
daa391c055 fix(TUP-19666) fix problem of switch branch for codegen
Remvoe the login task to execute the code when login the project
2018-03-04 21:23:28 +08:00
nrousseau
92a79ffb46 fix(TUP-19695) only add to classpath existing folders
Fix the issue of folder not existing, as i've found routines might not
have resources folder created. (not used actually)
2018-03-04 16:52:26 +08:00
nrousseau
dd180cf9ea fix(TUP-19700) fix memory issue 2018-03-04 16:38:40 +08:00
GGu
cb2a972cb3 fix(TUP-19523): check dynamic metadata for jdbc (#1456)
Conflicts:
	main/plugins/org.talend.core/src/main/java/org/talend/designer/runprocess/ProcessorUtilities.java
2018-03-04 16:36:55 +08:00
nrousseau
ff4e6ff62f fix(TUP-18552) fix classpath adjuster and tRunjob
Conflicts:
	main/plugins/org.talend.core/src/main/java/org/talend/designer/runprocess/ProcessorUtilities.java
2018-03-04 16:28:02 +08:00
nrousseau
7fd807ca69 fix(TUP-19605) add another fix for tdm adjuster 2018-03-02 15:02:23 +08:00
nrousseau
6f7d03f999 fix(TUP-19605) add another fix for tdm adjuster 2018-03-02 14:36:11 +08:00
zwxue
c500a6bc34 fix(TUP-19605):TDBOutput component can not support dataviewer. (#1480) 2018-03-02 13:13:36 +08:00
apoltavtsev
86f71023b2 TESB-21439 Beans added to Routelet dependencies (#1477) 2018-03-01 19:42:10 +08:00
zwxue
4d2a9ec311 fix(TUP-19635):Project setting ->Maven->project default xml content is (#1475)
null.
2018-03-01 17:31:02 +08:00
apoltavtsev
98cf6925a3 TESB-21427 Missing JobProcessor is resored (#1471) 2018-02-28 17:55:52 +01:00
apoltavtsev
c4e61238b4 TESB-21427 Lost SubJob Processor is restored (#1470) 2018-02-28 17:06:59 +01:00
GGu
92f6bf84a1 fix(TUP-19646): add the children libs always (#1467) 2018-02-28 18:24:04 +08:00
nrousseau
049179f69b fix(TUP-19590) Fix the problem of download of jar during build (#1466) 2018-02-28 17:00:18 +08:00
zwxue
15421355b9 fix(TUP-19595):generate job failed with Job compile errors. (#1465) 2018-02-28 16:53:31 +08:00
Mike Yan
8d81cd141d TESB-21414: Fixed unable to install Kar feature in runtime (#1464) 2018-02-28 08:46:33 +01:00
Jenkins Continuous Build server
780dde1d8b Set version to 7.0.1 EP2 2018-02-27 17:05:08 +01:00
203 changed files with 967 additions and 442 deletions

View 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>

View 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.common.ui.runtime.nl</artifactId>

View 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.commons.runtime.nl</artifactId>

View 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.commons.ui.nl</artifactId>

View 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.core.nl</artifactId>

View 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.core.repository.nl</artifactId>

View 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.core.runtime.nl</artifactId>

View 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.core.ui.nl</artifactId>

View 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.cwm.mip.edit.nl</artifactId>

View 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.cwm.mip.nl</artifactId>

View 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.designer.maven.ui.nl</artifactId>

View 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.help.nl</artifactId>

View 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.helpers.nl</artifactId>

View 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.librariesmanager.nl</artifactId>

View 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.librariesmanager.ui.nl</artifactId>

View 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.metadata.managment.nl</artifactId>

View 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.metadata.managment.ui.nl</artifactId>

View 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.migrationTool.nl</artifactId>

View 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.model.edit.nl</artifactId>

View 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.model.migration.nl</artifactId>

View 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.model.nl</artifactId>

View 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.presentation.onboarding.nl</artifactId>

View 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.rcp.nl</artifactId>

View 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.registration.nl</artifactId>

View 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.repository.items.importexport.nl</artifactId>

View 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.repository.items.importexport.ui.nl</artifactId>

View 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.repository.localprovider.nl</artifactId>

View 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.repository.mdm.nl</artifactId>

View 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.repository.metadata.nl</artifactId>

View 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.repository.view.nl</artifactId>

View 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.resources.nl</artifactId>

View 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.commons.feature</artifactId>

View 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.core.feature</artifactId>

View 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.fragment.jars.feature</artifactId>

View 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.help.feature</artifactId>

View 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.jdt.feature</artifactId>

View 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.libraries.jdbc.feature</artifactId>

View 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.m2e.feature</artifactId>

View 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.model.migration.feature</artifactId>

View 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>

View 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.rcp.feature</artifactId>

View 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.update.p2.feature</artifactId>

View 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.updates.feature</artifactId>

View 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.utils.feature</artifactId>

View 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.common.ui.runtime</artifactId>

View 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.commons.runtime</artifactId>

View File

@@ -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>

View File

@@ -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);
}
}

View 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.commons.ui</artifactId>

View 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.core.repository</artifactId>

View File

@@ -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;
}
}

View File

@@ -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;

View 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.core.runtime</artifactId>

View File

@@ -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);
}

View File

@@ -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;
}
}

View File

@@ -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);

View File

@@ -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() {

View File

@@ -191,4 +191,6 @@ public interface IDesignerCoreService extends IService {
public int getTACReadTimeout();
public void setTACReadTimeout(int timeout);
boolean isDelegateNode(INode node);
}

View File

@@ -293,6 +293,8 @@ public interface IProcessor {
String[] getJVMArgs();
Set<ModuleNeeded> getNeededModules();
Set<ModuleNeeded> getNeededModules(boolean withChildrenJobs);
Set<JobInfo> getBuildChildrenJobs();

View File

@@ -218,5 +218,7 @@ public interface IRunProcessService extends IService {
boolean isExportConfig();
void generateJobPom(ProcessItem processItem);
void initializeRootPoms();
}

View 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.core.ui</artifactId>

View 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.core</artifactId>

View File

@@ -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);

View File

@@ -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;

View 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.cwm.mip.edit</artifactId>

View 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.cwm.mip.editor</artifactId>

View 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.cwm.mip</artifactId>

View 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.datatools.xml</artifactId>

View 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.designer.maven.aether</artifactId>

View 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.designer.maven.tos</artifactId>

View File

@@ -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>

View File

@@ -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>

View 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>studio-maven-repository-tos</artifactId>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View 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.designer.maven.ui</artifactId>

View File

@@ -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.

View File

@@ -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;
}
}

View File

@@ -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);
}
}
});
}
}

View 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.designer.maven</artifactId>

View File

@@ -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.

View File

@@ -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 {

View File

@@ -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$

View File

@@ -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;
}
}

View File

@@ -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) {

View File

@@ -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);
}
}
/**

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -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$

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {

View 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>

View 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.helpers</artifactId>

View 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.libraries.apache.axis2</artifactId>

View 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.libraries.apache.batik</artifactId>

View 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.libraries.apache.cassandra</artifactId>

Some files were not shown because too many files have changed in this diff Show More