Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am developing the Talend component by using the command given on the Talend Component Wiki
mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=org.talend.components -DarchetypeArtifactId=components-api-archetypes -DarchetypeVersion=0.16.0 -DarchetypeRepository=https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/
this command generates all the required files to develop the Talend component. without modifying any of the files I build the jar files
using the
mvn clean install
but in that case got the error
Tests in error: OsgiFileInputTestIT.org.talend.components.fileinput.OsgiFileInputTestIT » TestContainer Tests run: 4, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] --- maven-failsafe-plugin:2.18:verify (default) @ file-input --- [INFO] Failsafe report directory: C:\Users\sunil.soni\Desktop\MultiJarIssue\file-input\target\failsafe-reports [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 05:31 min [INFO] Finished at: 2017-05-26T17:17:31+05:30 [INFO] Final Memory: 52M/277M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.18:verify (default) on project file-input: There are test failures. [ERROR] [ERROR] Please refer to C:\Users\sunil.soni\Desktop\MultiJarIssue\file-input\target\failsafe-reports for the individual test results. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
then I use the other command
mvn package
It works and I got few jar files.
the I used the file-input-0.1.0-bundle.jar to install the component by copying the file to TOS Directory/Plugins and started the Talend Studio.
the component is registered is successfully and visible in the palette
I can edit the configuration of the component
but when I try to connect the component with other component is ask for the jar file file-input-0.1.0.jar to run the job.
if I don't provide the jar the job won't run and gives the error
org.talend.components not found
If I install the jar then job runs successfully.
but I don't want to install the jar because all the files in the file-input-0.1.0.jar are already included in the bundle jar.
and this issue occurs without modifying anything.
I tried to check OSGi info and pom file but don't find anything. don't know what is wrong in the files.
any suggestion?
Hello,
first I suppose you have already changed somthing to the pom to get the testing error cause the archetype does not even compile because the nexus server used for the depenecies have be replaced by another one and therefore the url have changed.
So you probable have changed the pom <repository/> section with this
<repositories> <repository> <id>talend_nexus</id> <name>snapshots</name> <url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot/</url> </repository> <repository> <id>releases</id> <url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url> </repository> </repositories>
which is fine.
in order to make the test pass you also have to update the pom, again because of the nexus server url change.
please add in the <plugins/> section this.
<plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>2.18</version> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> <configuration> <systemProperties> <org.ops4j.pax.url.mvn.repositories>+https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot@snapshots@noreleases@id=talend_nexus,https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease@id=talrelease</org.ops4j.pax.url.mvn.repositories> </systemProperties> </configuration> </execution> </executions> </plugin>
Then you'll be able to build all the artifacts.
You second problem, the execution of the job relies on a jar the may not be a bundle and actually this not the same jar in the latest versions of the framework. I mean it is recommended to split the project in 2 modules (jars) one with the definition and one with the runtime.
Anyway, the Studio uses maven to discover the jar required when executing the job, so for your tests you have 2 choices:
I hope this helps.
Thanks for the support, will check and get back to you.