how to run maven project from github in eclipse - java

I use eclipse and I want to compile and run this code from gitub https://github.com/openphacts/Validator ,it needs maven project to build it but unfortunately I don't know how to proceed with it. Can someone help me how to get this project into eclipse to run it and test it in my machine please? It's emergency

Once you've checked out the project from github, you need to utilize maven to install the dependencies and build the project. In the root folder of the project (where the pom.xml is located), enter the following in your command line:
mvn install
More details can be found here: https://maven.apache.org/run-maven/
Additionally, you must first download the maven command line tool: https://maven.apache.org/download.cgi
And install it: https://maven.apache.org/install.html

Related

Not able to use MAVEN command

I don't know what's the problem but I am not able to use a maven for my projects.
This is the output of the command that means all the setup for maven is done properly but dont know why performing tasks is leading to a BUILD FAILURE.
mvn.cmd
mvn clean
You are in your main user folder vipul. The clean command is project specific, you need to be in the project path, a project which is configured for maven (has pom.xml file)
The error says you don't have a pom.xml file, which means you're running the command in the wrong directory or you haven't got the project set up. This quick Maven overview guide will help you set up a project if you haven't already.

Installing Maven and creating a maven project in eclipse

I am new to using maven project and i am trying to create a maven project and i followed the instructions to create one in eclipse and i gave the groupId and artifact id to it and clicked Finish, for which it gave me an error stating
"No marketplace entries found to handle
maven-compiler-plugin:3.1:compile in Eclipse. Please see Help for
more information."
For this issue i tried googling and stack overflow and i saw people asking other people to change the installation directory of maven inside
Window-> Preferences -> Maven-> Installation
I tried that and tried to update the maven project but still i have some errors, i am not able to setup my project, Could someone please help?
I am attaching the errors herewith.
First you can try to install maven globaly. follow the steps.
Download maven from maven download link
Create or export M2_HOME="MAVEN ROOT LOCATION". Ex. : E:\SoftwareRepo\building tools\apache-maven-3.5.2
Create or export MAVEN bin folder location to PATH variable.
For example: E:\SoftwareRepo\building tools\apache-maven-3.5.2\bin
Open terminal or cmd and run mvn --version to confirm maven is installed or not.
Then go to eclipse. and setup project.follow this steps
Import existing maven project or create a maven project
Goto project explorer and Right click on your pom.xml
then select Run As maven install.
and then what you want.
Hope it will serve your purpose. You can download a sample spring boot project from sample spring boot project
Or you can run a maven project from terminal or cmd. Just goto project root folder and then run a maven task like maven clean install .
Happy Coding :)
If a Maven project is configured to use ecj compiler, the following errors appear when importing the project into eclipse:
No marketplace entries found to handle maven-compiler-plugin:2.3.2:compile in Eclipse. Please see Help for more information.
No marketplace entries found to handle maven-compiler-plugin:2.3.2:testCompile in Eclipse. Please see Help for more information.
A fix should be trivial.
http://git.eclipse.org/c/m2e/m2e-core.git/tree/org.eclipse.m2e.jdt/lifecycle-mapping-metadata.xml reads:
<parameters>
<compilerId>javac</compilerId>
</parameters>
It should read:
<parameters>
<compilerId>javac</compilerId>
<compilerId>eclipse</compilerId>
</parameters>
Reproducible: Always
Steps to Reproduce:
1. Unpack example zip provided
2. Try to import it to Eclipse: File->Import->Maven->Existing Maven Projects
First install Java and then create the maven project.
Install the stable Java version in the system.
If Java is not installed then these types of errors will be displayed.
No marketplace entries found to handle
maven-compiler-plugin:3.1:compile in Eclipse.
Take a look at Help for more information.

On importing a maven project, does not displays the Maven dependencies in Eclipse

On importing a maven project into Eclipse, does not display the Maven dependencies in Eclipse. The command line mvn clean install is a success with all the test cases passed. But I am not able to see the dependencies. Also, I have tried maven clean, maven compile. I am also not able to see errors specified by eclipse if I make any syntax errors. Please let me know what needs to be done.

Maven Project using Eclipse doesn't compile

I have been trying to make a simple Spring project using Eclipse and Maven but I am running into problems. The first one I am trying to resolve is the fact that my code doesn't seem to compile.
For example, if in a class I type Strrrring test = new String(); there is not error at all displayed by Eclipse. I checked the Properties of the project, under Java Compiler and everything seems to be fine.
Command Line
If you have maven installed, you can make maven project working in Eclipse via mvn command. At the root of the project run:
mvn eclipse:eclipse
If you want to view the source/doc of the artifact used in your project, you can run following command instead:
mvn eclipse:eclipse -DdownloadSources=true
Eclipse Plugin
Or if you prefer use Eclipse plugin, you can install m2eclipse plugin and re-import project
Right click the project and do run as maven clean and maven install . It will work fine .

How to build a jar using Maven?

I want to build my project with Maven. How do I do that?
Maven is installed,
the project is called Sertsu1
it contains a pom.xml-file
What must be entered in the command line to start building?
If your project is organized as Maven expects, e.g. your source code is in the src\main\java directory you can run
mvn package
to just build your jar
mvn install
to install it in your local Maven repository
mvn clean
to remove a previous build
Beware that you won't go very far with Maven without reading about it. You can start with this book.
In order to create an artifact (jar-file) you need to invoke
mvn package
This is very basic and you should take your time to read the suggested manuals before using maven.
Navigate to the folder that contains the pom.xml and enter
mvn package
(for a quick result)
Your machine needs to be connected to the internet as maven will download a lot of files from public repositories.

Categories