Hello,
I’m quite a new URCap developer trying to figuring things out.
Currently i’m having some trouble with importing a 3rd Party Jar( specifically http://easymodbustcp.net/en/ ).
Just to explain my current project. I’m trying to control a Festo drive with an URCap through with the modbus protocol. Currently it’s done with a python daemon cap but i’m moving it to a java only project.
I’ve made a maven project excluding the UR library and this builds and installs normally ( ofcourse the pom script is way smaller, but it proved to me that maven succesfully imported the jar)
I’ve tried to import the same dependency script
<dependency> <groupId>de.re</groupId> <artifactId>easymodbus.modbusclient</artifactId> <version>1.0</version> </dependency>
When i add this to a ( working ) fresh URCap and run ‘mvn clean install’.
I get the following error :
[INFO] ----------------------< com.forfoxsake:festocap >----------------------- [INFO] Building festocap 1.0-SNAPSHOT [INFO] -------------------------------[ bundle ]------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ festocap --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ festocap --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source file to /home/ur/Documents/com.forfoxsake.festocap/target/classes [INFO] [INFO] --- maven-bundle-plugin:2.4.0:manifest (bundle-manifest) @ festocap --- [WARNING] Manifest com.forfoxsake:festocap:bundle:1.0-SNAPSHOT : Unused Import-Package instructions: [com.ur.urcap.api*, de.re.*] [INFO] [INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ festocap --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /home/ur/Documents/com.forfoxsake.festocap/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ festocap --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 1 source file to /home/ur/Documents/com.forfoxsake.festocap/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ festocap --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.forfoxsake.festocap.impl.AppTest [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.108 s - in com.forfoxsake.festocap.impl.AppTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] [INFO] --- maven-bundle-plugin:2.4.0:bundle (default-bundle) @ festocap --- [WARNING] Bundle com.forfoxsake:festocap:bundle:1.0-SNAPSHOT : Unused Import-Package instructions: [de.re.*, com.ur.urcap.api*] [INFO] [INFO] --- maven-assembly-plugin:2.2-beta-5:single (default) @ festocap --- [INFO] META-INF/MANIFEST.MF already added, skipping [INFO] META-INF/MANIFEST.MF already added, skipping [INFO] Building jar: /home/ur/Documents/com.forfoxsake.festocap/target/festocap-1.0-SNAPSHOT-jar-with-dependencies.jar [INFO] META-INF/MANIFEST.MF already added, skipping [INFO] META-INF/MANIFEST.MF already added, skipping [INFO] [INFO] --- exec-maven-plugin:1.1:exec (package-urcap) @ festocap --- [INFO] cp: missing destination file operand after 'target/festocap-1.0-SNAPSHOT.jar' [INFO] Try 'cp --help' for more information. [INFO] /bin/sh: 2: target/festocap-1.0-SNAPSHOT.urcap: not found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.074 s [INFO] Finished at: 2019-07-01T05:43:41-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:exec (package-urcap) on project festocap: Result of /bin/sh -c cd /home/ur/Documents/com.forfoxsake.festocap && cp target/festocap-1.0-SNAPSHOT.jar [ERROR] target/festocap-1.0-SNAPSHOT.urcap execution is: '127'. [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/MojoExecutionException`
And the strange this is, when i remove the dependency from the Pom file it still gives the same error.
Now as i am new to the world of Maven and UR i fail to understand the problem here, it says the program couldn’t cp something because the destination file was missing. So implying it couldn’t create the file?
I’ve look at every 3rd party jar post on this forum and tried them all but i get the same result. I feel like i’m missing something very important but i can’t figure out what and i don’t want to waste more time on it.
I’ll add the Pom files with the attemts to fix it when i get to work.
Ps. I’ve looked at the following forum posts :