Skip to main content
1-Visitor
June 20, 2015
Solved

How to resolve the problem of apache-maven

  • June 20, 2015
  • 2 replies
  • 6916 views

When I try to connect Raspberry Pi and ThingWorx,I have a trouble.So,

please let me know what to do.

On the manual,"2.-How-to-read-Temperature-and-Humidity-from-Am2302-

sensor-using-Thingworx-Edge-java-SKD-for-RPI",

if I enter "mvn package" on my PI,it will create the release jar file.

But,I can't failed to execute goal on project temperature-thing.

Are there some things that I should do other than appearing in the

manual?

For example,change the set point of /.m2/settings.xml,/temperature-thing

/pom.xml and so on.

I hope you will be able to provide the information.

Best answer by adrianpet

Hi,

You can install your jar locally and modify the pom.xml file under the comment:

<!-- This section adds the maven repository that contains the Thingworx jar -->

<!-- If you cannot access this repository, download your own copy and use the -->

<!-- bin/install-thingworx-jar.sh script to install it locally -->

Here, the new URL to the mvnrepo should be: http://maker01.cloud.thingworx.com/mvnrepo i believe that the current URL is now http://maker01.ptcmanaged.com/mvnrepo which is the former server that we used. So, you need to set the server address which is: http://maker01.cloud.thingworx.com/mvnrepo

Let me know how it went.


    I would like to ask every Academic user(a student or professor that is part of the Thingworx Academic program that has a hosted Thingworx in AWS) to post all their discussions on the Academic Forum (Academic Community​)

Thanks,

Adrian

2 replies

adrianpet5-Regular MemberAnswer
5-Regular Member
June 22, 2015

Hi,

You can install your jar locally and modify the pom.xml file under the comment:

<!-- This section adds the maven repository that contains the Thingworx jar -->

<!-- If you cannot access this repository, download your own copy and use the -->

<!-- bin/install-thingworx-jar.sh script to install it locally -->

Here, the new URL to the mvnrepo should be: http://maker01.cloud.thingworx.com/mvnrepo i believe that the current URL is now http://maker01.ptcmanaged.com/mvnrepo which is the former server that we used. So, you need to set the server address which is: http://maker01.cloud.thingworx.com/mvnrepo

Let me know how it went.


    I would like to ask every Academic user(a student or professor that is part of the Thingworx Academic program that has a hosted Thingworx in AWS) to post all their discussions on the Academic Forum (Academic Community​)

Thanks,

Adrian

marakawa1-VisitorAuthor
1-Visitor
June 23, 2015

Thanks.I'll try it immediately.

14-Alexandrite
August 5, 2015

I did a couple of things to get around this issue. Like the original poster, I was unable to connect to either remote maven repo. I had a copy of the ThingWorx 5.4 Java SDK, which contains thingworx-common-5.4.0.b445.jar, so I took Adrian's suggestion and installed it in my local maven repository. Here's the command to do that:


mvn install:install-file -Dfile=lib/thingworx-common-5.4.0.b445.jar -DgroupId=com.thingworx


    -DartifactId=thingworx-common -Dversion=5.4.0 -Dpackaging=jar





Some things to note about the command:

  • I'm obviously in the SDK's main directory, right above the /lib directory containing the jar.
  • I ran this command from the command line.
  • While the version on the end of the jar itself is 5.4.0.b445, I chose to pass a -Dversion parameter of 5.4.0 to make life easier when I wanted to use the jar.
  • The groupId is com.thingworx (you'll see why this matters when I talk about the pom file for the temperature-thing project).

The original project used version 5.0.0 of thingworx-common.jar, so I made the following modifications to the pom:

  • I changed the version to 5.4.0 (remember how I made the version 5.4.0 when I installed it? This is why.)
  • I noticed the groupId was com.thingworxs, instead of com.thingworx. I fixed that.



<dependency>


  <groupId>com.thingworx</groupId>


  <artifactId>thingworx-common</artifactId>


  <version>5.4.0</version>


</dependency>





I got lucky, and none of the other dependencies had to be changed. The temperature-thing built and deployed as expected, and I was able to run it in both simulated and "real" mode on two different Raspberry Pis.