cimt-talendcomp-maven-plugin [2.1]

Maven plugin to support JET based Talend component development

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

de.cimt.talendcomp
ArtifactId

ArtifactId

cimt-talendcomp-maven-plugin
Last Version

Last Version

2.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

cimt-talendcomp-maven-plugin [2.1]
Maven plugin to support JET based Talend component development
Project URL

Project URL

https://github.com/jlolling/talendcomp_maven_plugins
Source Code Management

Source Code Management

http://github.com/jlolling/talendcomp_maven_plugins.git

Download cimt-talendcomp-maven-plugin

How to add to project

<plugin>
    <groupId>de.cimt.talendcomp</groupId>
    <artifactId>cimt-talendcomp-maven-plugin</artifactId>
    <version>2.1</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.maven : maven-project jar 2.2.1
org.apache.maven : maven-plugin-api jar 3.5.4
org.apache.maven.plugins : maven-deploy-plugin jar 2.8.2
org.codehaus.plexus : plexus-utils jar 3.0.8
jaxen : jaxen jar 1.1.6
dom4j : dom4j jar 1.6.1

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Maven plugin to setup a Talend component

This plugin is bound to the phase package and performes for a talend component following tasks:

  • can copy the resources of an component from a source dir to a target dir before starting the processing
  • adds the necessary libraries according to the project dependencies to the component and deletes obsolete libs
  • Setup the IMPORT tags in the component XML configuration file
  • Setup the release date tag of the component and adds in the advanced settings a label showing release date and version
  • Setup the component version according to the project version
  • Checks the message properties (only the default) if all necessary message keys exist.
  • Checks the messages if the LONG_NAME property is present - needed to show a meaningful tool-tip for the component in the palette.

To use it in your own Talend component project use this plugin configuration. You can set configuration parameters in context of an execution of in for all executions. If you have more than one component in your project, use multiple executions, this example assumes 2 components. It is helpful to use the component name as id

	<plugin>
		<groupId>de.cimt.talendcomp</groupId>
		<artifactId>cimt-talendcomp-maven-plugin</artifactId>
		<version>2.1</version>
		<configuration>
			<checkMessageProperties>true</checkMessageProperties>
			<copyFromSourceBaseDir>src/talend_component/</copyFromSourceBaseDir>
			<componentBaseDir>${project.basedir}/talend_component</componentBaseDir>
			<studioUserComponentFolder>/Data/Talend/Studio/talend_user_components</studioUserComponentFolder>
		</configuration>
		<executions>
			<execution>
				<id>tComponent1</id>
				<goals>
					<goal>component</goal>
				</goals>
				<configuration>
					<componentName>tComponent1</componentName>
					<componentReleaseDate>20170106</componentReleaseDate>
					<noJars>false</noJars>
					<jarExcludePattern>log4j</jarExcludePattern>
				</configuration>
			</execution>
			<execution>
				<id>tComponent2</id>
				<goals>
					<goal>component</goal>
				</goals>
				<configuration>
					<componentName>tComponent2</componentName>
					<noJars>true</noJars>
				</configuration>
			</execution>
		</executions>
	</plugin>

Only the configuration parameter componentName is mandatory.

The other parameters will be filled with default values (the current values here).

The parameter componentReleaseDate will be filled with the current date if it is missing.

The parameter noJars prevents the plugin from adding jar files and adding IMPORT tags. This is useful if you have multiple components depending from another component which carries all libraries.

If some components needs dedicated jars and other don't you can use the jarExcludePattern to exclude with regex expressions jars from being used with the current executed component.

This is a typical maven log output:

--- cimt-talendcomp-maven-plugin:2.1:component (tFileExcelWorkbookOpen) @ jlo-talendcomp-excel ---
[INFO] ############ Setup component: tFileExcelWorkbookOpen with base dir: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/talend_component
[INFO] Check dependencies and collect artifact jar files...
[INFO]     file: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/target/jlo-talendcomp-excel-11.3.jar
[INFO] Collect project artifacts without scope [system, test, provided]
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/poi/poi-ooxml/4.1.0/poi-ooxml-4.1.0.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/poi/poi/4.1.0/poi-4.1.0.jar
[INFO]       Add file: /Users/jan/.m2/repository/commons-codec/commons-codec/1.12/commons-codec-1.12.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/commons/commons-collections4/4.3/commons-collections4-4.3.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/poi/poi-ooxml-schemas/4.1.0/poi-ooxml-schemas-4.1.0.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/xmlbeans/xmlbeans/3.1.0/xmlbeans-3.1.0.jar
[INFO]       Add file: /Users/jan/.m2/repository/org/apache/commons/commons-compress/1.18/commons-compress-1.18.jar
[INFO]       Add file: /Users/jan/.m2/repository/com/github/virtuald/curvesapi/1.06/curvesapi-1.06.jar
[INFO]       Add file: /Users/jan/.m2/repository/xalan/xalan/2.7.2/xalan-2.7.2.jar
[INFO]       Add file: /Users/jan/.m2/repository/xalan/serializer/2.7.2/serializer-2.7.2.jar
[INFO] Clean target and copy resources from source base dir: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/talend_component
[INFO]     Source and target component folder are the same. No cleanup proceeded and no files copied.
[INFO] Read component XML configuration...
[INFO]     XML configuration file: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/talend_component/tFileExcelWorkbookOpen/tFileExcelWorkbookOpen_java.xml sucessfully read
[INFO] Remove previous jars from component...
[INFO]     12 old jars deleted.
[INFO] Copy jars into component...
[INFO]     12 jars copied.
[INFO] Process component XML configuration...
[INFO]     setup imports removing  existing values ...
[INFO]     setup release and version info...
[INFO]     Done.
[INFO] Write back component XML configuration...
[INFO]     XML configuration file: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/talend_component/tFileExcelWorkbookOpen/tFileExcelWorkbookOpen_java.xml successfully written.
[INFO] Check message properties...
[INFO]     Read message properties file: /Data/Talend/workspace_talend_comp/talendcomp_tFileExcel/talend_component/tFileExcelWorkbookOpen/tFileExcelWorkbookOpen_messages.properties
[INFO] Copy component files to studio custom component dir: /Data/Talend/Studio/talend_user_components
[INFO]     19 files copied.
[INFO] Finished.

The result e.g. a list of the necessary modules within a Talend component XML configuration. Example:

  <CODEGENERATION> 
    <IMPORTS> 
      <IMPORT NAME="jlo-talendcomp-excel" MODULE="jlo-talendcomp-excel-11.3.jar" MVN="mvn:org.talend.libraries/jlo-talendcomp-excel-11.3/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="poi-ooxml" MODULE="poi-ooxml-4.1.0.jar" MVN="mvn:org.talend.libraries/poi-ooxml-4.1.0/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="poi" MODULE="poi-4.1.0.jar" MVN="mvn:org.talend.libraries/poi-4.1.0/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="commons-codec" MODULE="commons-codec-1.12.jar" MVN="mvn:org.talend.libraries/commons-codec-1.12/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="commons-collections4" MODULE="commons-collections4-4.3.jar" MVN="mvn:org.talend.libraries/commons-collections4-4.3/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="commons-math3" MODULE="commons-math3-3.6.1.jar" MVN="mvn:org.talend.libraries/commons-math3-3.6.1/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="poi-ooxml-schemas" MODULE="poi-ooxml-schemas-4.1.0.jar" MVN="mvn:org.talend.libraries/poi-ooxml-schemas-4.1.0/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="xmlbeans" MODULE="xmlbeans-3.1.0.jar" MVN="mvn:org.talend.libraries/xmlbeans-3.1.0/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="commons-compress" MODULE="commons-compress-1.18.jar" MVN="mvn:org.talend.libraries/commons-compress-1.18/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="curvesapi" MODULE="curvesapi-1.06.jar" MVN="mvn:org.talend.libraries/curvesapi-1.06/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="xalan" MODULE="xalan-2.7.2.jar" MVN="mvn:org.talend.libraries/xalan-2.7.2/6.0.0-SNAPSHOT" REQUIRED="true"/>
      <IMPORT NAME="serializer" MODULE="serializer-2.7.2.jar" MVN="mvn:org.talend.libraries/serializer-2.7.2/6.0.0-SNAPSHOT" REQUIRED="true"/>
    </IMPORTS> 
  </CODEGENERATION>  

This plugin is available via Maven Central since 2018-07-20.

Versions

Version
2.1
1.8