cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to resolve the problem of apache-maven

marakawa
1-Visitor

How to resolve the problem of apache-maven

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.

ACCEPTED SOLUTION

Accepted Solutions
adrianpet
12-Amethyst
(To:marakawa)

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

View solution in original post

7 REPLIES 7
adrianpet
12-Amethyst
(To:marakawa)

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

Thanks.I'll try it immediately.

Is there a more recent location of the maven repository than http://maker01.cloud.thingworx.com/mvnrepo

The old and the new location are both not available.

Or can someone provide the required .jar file.

I know this Raspberry PI Academic program example is old, but it is still available from the ThingWorx main web site.

Can anybody reply to the above query or let know from where the thingworx-common jar can be manually downloaded,

Downloaded the protocol-adapter-sdk from the below link, which had the 5.4.0 version of thingworx-common.

 

https://marketplace.thingworx.com/tools/protocol-adapter-sdk

 

sharmon
13-Aquamarine
(To:marakawa)

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.

Announcements
Top Tags