Not able to find javapasswordsdk.PSDKPasswordRequest maven dependency - java

I am working on migrating one project to maven. I can see 2 import statements in legacy code like:
import javapasswordsdk.PSDKPasswordRequest;
import javapasswordsdk.exceptions.PSDKException;
I dont see any maven dependency available in maven central for these imports to add in my pom.xml.
Can anybody help me to get this jar ?

The classes mentioned are part of a commercial offering called cyberark.
See the following Cyberark Enterprise vault product page
This library won't be up on maven central.
If an internal maven repo exists it may be there. Otherwise, this library is often packaged with application using the provided scope
<dependency>
<groupId>com.cyberark</groupId>
<artifactId>JavaPasswordSDK</artifactId>
<scope>provided</scope>
</dependency>

Related

Working with US customary units of measurements in JSR 363 library

I've stumbled upon the JSR unites of measurements library and I'm a little bit lost, now I'm trying to replicate the demo file that gives the basic idea about how the library works. The thing is that I can't get any of these classes/packages:
import static si.uom.SI.*;
import static systems.uom.common.USCustomary.METER;
import static systems.uom.common.USCustomary.MILE;
import static tec.units.ri.unit.MetricPrefix.*;
when I type them in my class they're not resolved, now I have downloaded the JAR file and Included it in my project, is there anything else I'm supposed to do?
When you use maven to handle your project dependencies you don't manually download jars. Instead you use maven to automatically download them. Maven stores information about the project dependencies in a pom.xml file. Most Java IDEs can read this pom file and provide autocompletion for clases included in the jars listed as dependencies.
In this case, you should include this in your pom.xml, in the dependencies section.
<dependency>
<groupId>javax.measure</groupId>
<artifactId>unit-api</artifactId>
<version>1.0</version>
</dependency>

Android Support Library v7 + Maven + Eclipse: apklib dependency not found in workspace

I'm trying to configure the library v7 support in my project so that it uses ActionBarActivity, thus keeping compliant with some of the Android 2.X versions.
First, follow the documentation from Google and imported the project android-support-v7-appcompat as a library in accordance with Section Adding libraries with resources on Support Library Setup. But this way my Maven Build failed because it could not find the dependence of the library in question.
Now, I decided to seek a cleaner solution, keeping my dependences managed by Maven. To do this follow the instructions of the answer, but using version 19.0.1. This made my Maven Build it were executed successfully, but my project is not compiling in my workspace, the following error occurs on first line of my POM:
dependency=[com.android.support:appcompat-v7:apklib:19.0.1:compile]not found in workspace
My dependencies are as follows:
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>jar</type>
</dependency>
The project in question is on GitHub, if they want to view it: https://github.com/veniltonjr/msplearning
Thank you in advance!
First, there is no apklib for com.android.support:appcompat-v7. It only ships as an aar.
Second, that library is not available in maven-central, it ships with the Android SDK.
You need to manually deploy it to your local maven repository.
Though you can use maven-sdk-deployer to construct and deploy the apk to your local folder. But you github project is failing due to missing internal dependencies.
com.msplearning.android-support-v4:jar:19.1.0, com.msplearning:android-support-v7-appcompat:jar:19.1.0

Want to import a library into my Java project

I would like to add this to my imports and use it to verify URI addresses however, I am having trouble figuring out how to properly import this http://www.jdom.org/docs/apidocs/org/jdom2/Verifier.html. Do I have to update my Maven repo? I understand that it is included in java.lang.Object, but when I include that it can't find Verifier.
Can someone please help me understand the problem here?
Ejay
You can get JDOM 2.0.2 from Maven Central Repository:
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
Here is a link to Maven Central Search for JDOM 2.0.2
I just pulled down jdom-2.0.2.jar from here and verified that it does contain org.jdom2.Verifier.class
The jdom2 project isn't available (yet) through Maven. (You can't just add some XML to your POM.)
You can download the JAR file here:
http://www.jdom.org/downloads/index.html
This SO question discusses how to use a plain JAR file with your Maven project:
Can I add jars to maven 2 build classpath without installing them?

How to import org.apache Java dependencies w/ or w/o Maven

So the quick background is I am creating a java program, that uses many different imports
import org.apache.hadoop.conf.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.util.*;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
I know that Netbeans isn't finding these files because I do not have them on my computer. But is there a way to have Netbeans automatically connect with org.apache and retrieve these files? Or do I just have to go and download them. Someone recommended using Maven, but I am not sure if this is the right solution or how to go about that?
Thanks
Unless you use a Maven structure (see here getting started with Maven) you will have to download all jars manually.
If using only Hadoop (as in your example) this might not seem that much of a deal, but when working with big projects it is easier to declare your dependencies in a pom.xml file. It is much more easier than downloading X different jars, and you can easily move to a newer version of a library, rather than having to delete and and download another.
I saw that someone asked in a comment why people like Maven so much. Well, to be honest, I personally find it easy to use and very useful. Furthermore, a Maven project can be easily imported in IntelliJ, Eclipse or Netbeans, whereas creating for example an IntelliJ project can cause difficulties in importing it in Eclipse or NetBeans.
To get started using Maven with Netbeans, you can go to: New Project, Categories:Maven Projects:{Best Option}. Then in the project files, open pom.xml. Here is where dependencies for your project are added. If you are not sure what to insert try searching for your jar name + "maven" on the internet. The plugin for Netbeans is able to connect to the maven repository and autocomplete most fields.
Sample from: http://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.6
<project...>
....
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
</dependencies>
...
</project>
Download the .jar file here: http://mvnrepository.com/artifact/org.apache.hadoop/hadoop-core/0.20.2
In Eclipse, right-click on your project, click Properties, search in the text box for Library, click on Build Paths, click Add External JAR, and select the file you downloaded from the link above.
You will have to download the jar-files yourself. Unless you start using Maven or a similar dependency management tool.
You must download them. The name org.apache.hadoop is a package name, and we only use the name of the site as a convention. See this tutorial on packages for more information. Essentially a package is a folder on your computer, often in the Java\jre\lib\ext\ directory.
Refer tutorial
http://www.tutorialspoint.com/hadoop/hadoop_mapreduce.htm
It mentions :-
Download Hadoop-core-1.2.1.jar, which is used to compile and execute the MapReduce program. Visit the following link http://mvnrepository.com/artifact/org.apache.hadoop/hadoop-core/1.2.1 to download the jar.
Not a netbeans user , but I'm sure that even in netbeans, you have a maven plugin.
"Mavenize" your project, and when you will perform mvn clean install, you will get these jars to local maven repository.
With Eclipse I use the m2Eclipse plugin and it works really well for me.
This of course depends that these jars can be found in maven repositories over the net, such as maven central repository.
I have final figured out my preferred way to create a new Hadoop project and import the dependencies using Maven.
Using NetBeans I create a new Maven project.
Then under project files, I open the pom.xml.
I finally add inside of
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>0.20.2</version>
</dependency>
After building with dependencies I am now ready to code.

wso2 resolve missing dependencies

I've successfully managed to run the code from this tutorial, using carbon studio, maven and m2e on my GReg server on localhost:
http://www.smartjava.org/content/access-wso2-registry-programatically
Now I want to create create a new Artefact, following the documentation at
http://docs.wso2.org/wiki/display/Governance450/Configurable+Governance+Artifacts+with+API
The problem is that I don't know which libraries to include for those imports and my built with maven project doesn't have them. (I use the pom.xml from the first tutorial)
import org.wso2.carbon.governance.api.generic.GenericArtifactManager;
import org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifact;
This was happens due to unavailability of governance API dependency. Please add below dependency to your pom.xml
`<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.governance.api</artifactId>
<version>4.0.3</version>
</dependency>`

Categories