can not find osgi.enroute.iot.pi.provider dependency - raspberry-pi

I am trying to do this tutorial
http://enroute.osgi.org/tutorial_iot/120-exploring.html
but I have got a problem with:
osgi.enroute.iot.pi.provider
package is not find so I can resolve bndrun dependencies:
Unable to resolve <<INITIAL>> version=null:
missing requirement osgi.enroute.iot.pi.provider
and when I try with
osgi.enroute.iot.pi.command
dependencies not found:
Unable to resolve <<INITIAL>> version=null:
missing requirement enroute.iot.raspberry.application
-> Unable to resolve enroute.iot.raspberry.application version=1.0.0.201611270001:
missing requirement com.pi4j.system]
I manually dowload and add pi4j in my project build path so I haven't no more eclipse problem but I fell that it is not a good solution for osgi and it not run on my remote raspberry ssh console...

Thanks to Daghan from the osgi mailing list who provide a solution:
"osgi.enroute.iot.pi.provider" is no longer a part of enroute distro. Please remove the manually downloaded pi4j from your project and do the following:
1- open cnf>central.xml
2- Add the following
<!-- https://mvnrepository.com/artifact/org.osgi/osgi.enroute.iot.pi.provider -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.enroute.iot.pi.provider</artifactId>
<version>2.0.0</version>
</dependency>
This solve my problem but the include pi4j dependency isn't up to date for raspberry so I prefer add
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-core</artifactId>
<version>1.1</version>
</dependency>
and everything works like a charm now!

Related

com.day.cq.dam.commons.util,version=[1.50,2) -- Cannot be resolved

I'm trying to run AEM 6.5 however i'm running into an issue below:
com.day.cq.dam.commons.util,version=[1.50,2) -- Cannot be resolved
It can boot up Author, but there is no content and it looks like that's the only source of the error I can see.
You can add the maven dependency in your pom.xml and build and install the code in AEM and check if this issue still exists.
<dependency>
<groupId>com.day.cq.dam</groupId>
<artifactId>cq-dam-commons</artifactId>
<version>5.6.6</version>
<scope>provided</scope>
</dependency>

Could not find or load main class org.scalatest.tools.Runner

Created the maven scala project.
I had correctly specified all the configuration . But still facing this error.
any help appreciated.
I solved this error.
Its coming because I had make the entry for org.scalatest plugin and there is no src/test/scala dir and no test cases.After removing org.scalatest plugin entry from pom file everything work fine.
For anyone that comes across this issue in the future, make sure you have the following dependency in your pom.xml.
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_2.11</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>

Cannot resolve import after Maven configuration

I have a web dynamic project on eclipse running on Tomcat.
I need to add the dependency of the JWT library on Maven dependencies. So I configured my project to Maven, and the I added the dependency on the pom.xml.
Now eclipse doesn't resolve my dependency, for example if I import a package of JWT there is a red line that highlights my import.
But there is another problem:
all the library that I imported like hibernate, apache-common (that I previously copied in WEB-Lib) that before worked, now are unresolved.
How may I face this problem? This is the first time using Maven, so if I'm wrong in something, please tell me.
Thanks in advice.
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.6.0</version>
</dependency>
This dependency worked for me

Missing artifact "sun.jdk:jconsole:jar:jdk"

When adding Arquillian to a Maven build I get the above exception in Eclipse:
Missing artifact sun.jdk:jconsole:jar:jdk
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.7.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-dbunit</artifactId>
<version>1.0.0.Alpha7</version>
</dependency>
(The message is not the problem, but that Eclipse refuses to compile the project because of it. Maven works, though.)
Naturally the first thing I did was trying to exclude it from the Maven dependencies (wildfly-arquillian-container-managed is where the dependency tree states the dependency comes from):
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<exclusions>
<exclusion>
<artifactId>jconsole</artifactId>
<groupId>sun.jdk</groupId>
</exclusion>
</exclusions>
</dependency>
There was no change. I tried to start Eclipse with -vm C:\Program Files\Java\jdk1.8.0_60\bin. And tried to edit the JDK in "Preferences -> Installed JREs" to contain the JAR in the tools directory. But nothing works.
What can I do?
I put my dependencies like this and it works fine:
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId>
<version>8.1.0.CR1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.15</version>
<scope>test</scope>
</dependency>
<!-- Arquillian -->
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-embedded</artifactId>
<version>8.1.0.CR1</version>
<exclusions>
<exclusion>
<groupId>sun.jdk</groupId>
<artifactId>jconsole</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
See that the exclusion tag is in the "wildfly-embedded" dependency...
Don't forget to command "mvn install" and click right button at project and "Maven Update", if it doesn't work try delete folder "~/.m2/repository" and download all the dependencies again.
Alastair, thanks for solving the problem. The cause lies in the the pom of the transient dependency org.wildfly:wildfly-cli (8.2.0.Final). There you can find the following dependency declaration:
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>jconsole</artifactId>
<version>jdk</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/jconsole.jar</systemPath>
</dependency>
Actually, the jar is located in ${java.home}/lib/jconsole.jar.
P.S.: The version is also insufficient. So, I deleted this version from my local maven repository.
I faced this while working in a Windows machine. The project itself worked perfectly fine in my Ubuntu machine. However the project's build failed with exactly that message, induced by a transient org.wildfly:wildfly-ejb dependency.
Missing artifact sun.jdk:jconsole:jar:jdk
I didn't feel the project configuration needed to be changed as it's supposed to just work fine across all environments and thus the Windows environment itself must have been wrong. My first thought was that Eclipse itself is in some way using JRE instead of JDK.
So I checked java -version in CMD and it appears to point to a JRE installed somewhere in /Program Files folder while I've always been manually installing JDKs in /Java folder. Then I inspected the %PATH% environment variable in Windows settings. It appears to include a /ProgramData/Oracle/Java/javapath. That folder contained a few symlinks to the JRE in /Program Files folder. That was thus actually being used to start Eclipse and run all its tasks. When I removed it (there was already a JDK/bin further down in %PATH% setting) and restarted Eclipse and re-executed Maven build, the error went away.
No changes needed to pom.xml or Eclipse configuration. Just watch out with what's Windows all installing and updating for you in the background and check your %PATH% if it still has JDK in top.
The reason of the problem is that the jconsole.jar is part of the jdk, thus it is not distributed as an ordinary maven package.
Typically, project pom.xmls insert this jconsole.jar as a system package, i.e. it doesn't even try to download them from the central maven repo. Although it would be possible to distribute it also on this way.
The simplest solution of the problem is to use a jdk which contains this jconsole.jar.
Alternatively, you can download this jar from anywhere, only you have to make it reachable in the compilation classpath.
Or, you can also modify the pom.xml, or install the package manually into your local maven repo, as the other answers state.
I spent the best part of a day fighting this problem. Simple solution is to manually install the missing jar from your jdk using maven, something like:
c:\workspace\prism>mvn install:install-file -Dfile=C:\java\jdk\lib\jconsole.jar -DgroupId=sun.jdk -DartifactId=jconsole -Dversion=1.8 -Dpackaging=war.
Who knows why eclipse cannot do this ...
Maybe is more of a workaround than a proper solution, anyway I solved this issue by removing the profile "activebydefault" in the pom. This way, Eclipse won't complain for the "Missing artifact sun.jdk:jconsole:jar:jdk" but the JUnit test won't run in Eclipse - as I use testing only from maven test, and not the Eclipse embedded JUnit runner, it just need to specify which profile ID you want to run against.
I was facing the same issue, but none of this was a perfect solution for me. Steps to solve :
Check if you are pointing to the JDK location correctly :
echo $JAVA_HOME
Open pom.xml from IDE (mine is eclipse), select Dependency Hierarchy, and search for jconsole. If you see jconsole, it is because sometimes jconsole would be given as an interdependency and the path given could not be recognized. Excluding that jar will solve the issue.
Dependency Hierarchy
Interdependent jconsole
Exclusing jconsole
i was searched jdk full name.
(cos i was used when startethe 1.8.0_191 but after change laptop. its also changed to 1.8.0_282)
so i was searched at STS.
there is a string(java path) at the .factorypath.
so i change that.
its fixed now.
guys try this way~

Is there a procedure to be followed to add external jars to a custom confluence plugin development environment

I added this dependency chunk in my pom.xml
<dependency>
<groupId>freeway</groupId>
<artifactId>axis</artifactId>
<version>1.0</version>
</dependency>
I have placed my jar file in the folder C:\jarhost\axis-1.0.jar
And i ran the command
mvn install:install-file -Dfile= "C:/jarhost/axis-1.0.jar" -DgroupId=freeway -DartifactId=axis -Dversion=1.0 -Dpackaging=jar
And this is the error i get is this
http://imageshack.us/f/580/cmdimage.png
I also stumbled upon this https://confluence.sakaiproject.org/display/DOC/Adding+JARs+to+an+Application and tried it too. But it was unable to 'download' dependencies.
What am i missing ?Looking for your help on this.
Thanks
A
You can instal your jar with your plugin by adding dependencie in your pom.xml
in your case i think you need to add scope compile
eg.
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>compile</scope>
</dependency>
you can read about it here
and another advice if you start create plugin is best practise is to use Confluence atlas-cli , mvn-instal not help you in this way.
Also i advice you to read this very usefull docs here you can find a lot's of nice docs which can help you to develop plugins for confluence much more easier.
Angela,
maybe you run into this bug:
Unfortunately there's a bug in the Atlassian Plugin SDK that prevents
the atlas-* batch files from correctly interpreting command-line
parameters that contain an equals sign
The workaround is to call "%ATLAS_HOME%\apache-maven\bin\mvn" instead of "atlas-mvn".
https://studio.atlassian.com/browse/AMPS-197
https://ecosystem.atlassian.net/browse/AMPS-353
https://answers.atlassian.com/questions/20341/configuring-eclipse-to-use-the-atlassian-plugin-sdk
My solution was the following:
edit %ATLAS_HOME%\bin\atlas-mvn.bat
locate the line if "%1"=="" goto loopend (in my case it was line 69)
change it to:
if `%1`==`` goto loopend
Hope this solves your problem!