Importing maven library and maven sample in Eclipse project - java

I know its quiet irrelevant question but I have banged my head too much but found no solution for that..I am building android app which can read contents from NFC cards.I am using this library to perform my job https://github.com/devnied/EMV-NFC-Paycard-Enrollment .But there is also the sample app for this library in this link which I can't import in my Eclipse.Also I need to know how to import this library in my project.
Please help me out.
Regards
BSOFT

This is a maven project (indicated by the presence of pom.xml), so you need to first install maven from http://maven.apache.org/download.cgi
Then, navigate to the library root directory and run mvn eclipse:eclipse to generate eclipse project files. You can then import the library into eclipse as a standard Java Project.
To import the library into your own project, run mvn install from the library root directory to build a jar and install it to your local maven repository. In your local project, you can then either add a dependency on the jar (find it in your maven repository, ~/.m2/), or use maven in your own project and add the library as a dependency in your pom.xml.

Related

What are the correct jar files for Jzy3d API?

Can someone tell me which .jar files to download to get the newest Jzy3d version? I have looked at their website but I don't know which files to download.
The easiest way is to use maven to build Jzy3d charts. Install maven if you don't have it.
Add a maven pom.xml file at the root of your project, similar to this one. Running the following command will import dependencies and build the project
mvn clean test install
If you want to retrieve jar manually (discouraged), you can get jzy3d builds here. You will also have to download jzy3d dependencies (jogl, jply, jmathio, jdt-core, miglayout, opencsv, etc) as listed in jzy3d-api pom file.

Importing a library project from Git into my project didn't work (Eclipse)

I have been trying to import https://github.com/oguzbilgener/CircularFloatingActionMenu library into my project, but it didn't work.
I have clone the repo and imported into my project.
I have set in library settings android that it is library and imported.
Nothing happens. Other libraries are working.
Any suggestion?
As I can see from the link you provided this is a gradle project (built with gradle), so I'm assuming you need to build it and then add it to your project as a dependency.
You need to have gradle installed on your machine and then you can build a jar by calling
gradle fatJar
in the root folder of library.

Does maven import option in intelliJ imports jars from remote repositories as well

Hi I am trying to build maven project using intelliJ.
I wanted to know what the maven import option does?
Apart from importing files from local repository and remote maven repository, does it imports/ updates files from SVN repository (which I am using).
So do I need to checkout the code from repository everytime or import option does this ?
Thanks
The maven import functionality in IntelliJ works as follows:
If you want to use an existing Maven project, you can import it directly by opening its pom.xml file. When a Maven project is imported, it maps to an IntelliJ IDEA module with the name, which is equal to the Maven project's artifactId. Dependencies between the Maven projects map to the dependencies of IntelliJ IDEA modules from the libraries and other modules. IntelliJ IDEA analyzes the pom.xml file and automatically downloads the necessary dependencies.
It will not checkout code from your SVN repository. Maven is a build tool that helps manage dependencies that your package may have, while SVN is a version control system that is meant to track changes you make to code.

Import jar from ant ivy project to maven

I am working on an ant project and i want to use the jar created by it , in my maven project.
The ant project employs ivy to manage its dependency.
Is there any easy way to do this if possible without changing any code on their side.
It sounds like you want to be able to publish artefacts generated by your ivy-based project to a maven repo so they can be resolved by the mvn-based project.
Try http://draconianoverlord.com/2010/07/18/publishing-to-maven-repos-with-ivy.html
Once the ivy-based project has published its artefacts to the mvn repo, then the mvn-based project should be able to resolve the published artefacts.

Integrating a maven project into Eclipse

I have a maven module for validation which I must pass to a old version of Eclipse which has the Jrules API within. However there is not a maven plugin for this eclipse IDE. So I figured I would do a maven:install on the module and move over the created jar.
However when I try to import->Existing Projects into Workspace->Select archive file:
and point it to the jar no projects appear. I'm at a loss as to how I can move my maven module to the outdated eclipse, without having to grab the 101 jars required for the project and non mavenise it...
Surely their has to be an easy way to this or is maven will monolithic
Use the maven-eclipse-plugin to generate the .project and .classpath files for you:
mvn eclipse:eclipse
This will create the IDE metadata files which reference all of the JARs your project depends on from within your local maven repository folder.
Attempting to import the JAR that is built by the Maven build process into Eclipse using the " import->Existing Projects into Workspace->Select archive file" doesn't work because Eclipse expects to find a .zip/.jar file with the .project metadata files and the source code. Your compiled JAR likely contains neither.
I would recommend using the M2Eclipse maven plugin. Right click the project -> Enable Dependency Management -> Update Project Configuration
I have used eclipse:eclipse extensively and my experience is that M2Eclipse is not only better supported but works better overall.

Categories

Resources