How to download "com.dalsemi.onewire" package? - java

I want to run uniCent open source in my laptop but don't able to find onewire library. my import are:
import com.dalsemi.onewire.OneWireAccessProvider;
import com.dalsemi.onewire.adapter.DSPortAdapter;
import com.dalsemi.onewire.container.OneWireContainer;
import com.dalsemi.onewire.application.monitor.*;
How can I download these jar files?

Locate the repositories section and replace it with this :
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>unicenta-repo</id>
<url>https://repo.unicenta.org/maven2/</url>
</repository>
<repository>
<url>https://download.java.net/maven/2/</url>
<id>restapi</id>
<layout>default</layout>
<name>Repository for library Library[restapi]</name>
</repository>
<repository>
<id>central-maven-repo</id>
<url>https://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
</repositories>
Add below dependency :
<dependency>
<groupId>com.dalsemi.onewire</groupId>
<artifactId>owapi</artifactId>
<version>1.10</version>
</dependency>
Give it a try by running mvn clean install command.

Related

spring-data-jdbc dependency won't work on pom.xml

I'm following this guide spring-data-jdbc-ext
and i'm trying to set this dependency on my pom.xml
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jdbc</artifactId>
<version>1.0.0.M2</version>
</dependency>
but i ended up on this error
No such file or directory found on the repository using this maven dependency (provided on the quick start guide).
I'm using Maven version 4.0.0
Add this repository to your pom:
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

Example Code imports are missing in jzy3d

The Example code imports are missing. Does anyone know what I not including?
I got the imports for mvn from http://www.jzy3d.org/download-0.9.1.php
The example code is from https://github.com/jzy3d/jzy3d-api/tree/master/jzy3d-javafx/src/main/java/org/jzy3d/demos/javafx
and these three imports are causing problems. I didn't see any other mvn imports
import org.jzy3d.javafx.JavaFXChartFactory;
import org.jzy3d.javafx.JavaFXRenderer3d;
import org.jzy3d.javafx.controllers.mouse.JavaFXCameraMouseController;
<!-- <dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>1.0.0</version>
</dependency>-->
<dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>0.9.1</version>
</dependency>
<!-- <dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-api</artifactId>
<version>0.9.2-SNAPSHOT</version>
</dependency>-->
<repositories>
<repository>
<id>jzy3d-snapshots</id>
<name>Jzy3d Snapshots</name>
<url>http://maven.jzy3d.org/snapshots</url>
</repository>
<repository>
<id>jzy3d-releases</id>
<name>Jzy3d Releases</name>
<url>http://maven.jzy3d.org/releases</url>
</repository>
</repositories>
Those classes are available in this maven dependency.
<dependency>
<groupId>org.jzy3d</groupId>
<artifactId>jzy3d-javafx</artifactId>
<version>1.0.0</version>
</dependency>
Add only the release repository.
<repositories>
<repository>
<id>jzy3d-releases</id>
<name>Jzy3d Releases</name>
<url>http://maven.jzy3d.org/releases </url>
</repository>
</repositories>

Maven: copy local jar to target dir

I want a local jar located in C:/myLibs/TDKLogging/TDKLogging-2.1.6.jar
to be copied to my target dir when generating the war, so I modified my pom as follows:
<repositories>
<repository>
<id>JBossNexus</id>
<name>JBoss Nexus Repository Manager</name>
<layout>default</layout>
<url>https://webgate.tdk.com/JBoss/nexus/content/groups/public</url>
</repository>
<repository>
<id>my-local-repo</id>
<url>file://C:/myLibs/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>tdk.com.iot.log</groupId>
<artifactId>TDKLogging</artifactId>
<version>2.1.6</version>
<type>jar</type>
</dependency>
..
But I got this error
Could not find artifact tdk.com.iot.log:TDKLogging:jar:2.1.6 in tdkPublicRepository (https://webgate.tdk.com/JBoss/nexus/content/groups/public)
How to tell maven to search the artifact in a specific repo ???? Can a project work with more than 1 repo at the same time ???? because I only have 1 jar in the local repo, the others ones are stored in the public repo
you may have more than one repo specified.
<repositories>
<repository>
<id>Webgate repository</id>
<url>https://webgate.tdk.com/JBoss/nexus/content/groups/public/</url>
</repository>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>java.net</id>
<url>https://maven.java.net/content/repositories/public/</url>
</repository>
</repositories>
What about your particular situation - you have to add your jar and pom to your local repository. You have to run few commands.
Check this
How to include custom library into maven local repository?
and this Guide to installing 3rd party JARs

Maven doesn't find dependency

I added a dependency in maven for servlet as seen here, here and here
Maven doesn't find it :
dependency javax.servlet:javax.servlet-api:3.0.1 not found
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
I tried to add this, which doesn't work :
<repository>
<id>maven2</id>
<url>https://mvnrepository.com</url>
</repository>
or this:
<repository>
<id>maven2</id>
<url>http://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.0.1/</url>
</repository>
First of all you need to verify if you have Internet connectivity and then you can try to purge and resolve the dependencies in the local Maven repository as there could be some corrupted package, you can try the following command to accomplish this:
mvn dependency:purge-local-repository
Take a look to Purging local repository dependencies for more information.
Use default repostiory:
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
Don't do like this: http://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.0.1/
Even you should remove all content of the tag <repositories> or <repository> and all things inside these, Maven will automatic use default configuration.
Reference:
http://maven.apache.org/pom.html#The_Super_POM

Artifact com.oracle.toplink:toplink:jar:10.1.3 not found

I am trying to create a spring 4 project from scratch and maven is unable to resolve the dependency of com.oracle.toplink:toplink:jar:10.1.3
The following are the repositories that I have set in the pom.xml
<repositories>
<repository>
<id>repo2.maven.org</id>
<name>repo2.maveng.org</name>
<url>http://repo2.maven.org/maven2</url>
</repository>
<repository>
<id>repo1.maven.org</id>
<name>repo1.maven.org</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>java.net</id>
<name>java.net</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>EBR Spring Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>EBR External Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>repo.spring.io</id>
<name>repo.spring.io-releases</name>
<url>http://repo.spring.io/ext-release-local</url>
</repository>
</repositories>
Questions:
Which repo should I add to make sure maven resolves this dependency?
Usually, how does one know which repo has a particular artifact belong to?
The error message I see is below. Does this error mean Maven did not try looking up for it in other repositories mentioned?
Could not find artifact com.oracle.toplink:toplink:jar:10.1.3 in repo2.maven.org (http://repo2.maven.org/maven2) -> [Help 1]
The is Oracle toplink - toplink-10.1.3 in maven's Central repository http://repo1.maven.org/maven2. So you just only need to add the dependency in pom.xml, not the repository.
<dependency>
<groupId>com.oracle.toplink</groupId>
<artifactId>toplink</artifactId>
<version>10.1.3</version>
</dependency>
Source:
http://mavenhub.com/mvn/central/com.oracle.toplink/toplink/10.1.3
http://mvnrepository.com/artifact/com.oracle.toplink/toplink/10.1.3

Categories