Can't build project through intellij-idea with maven, but through console command "mvn package" build successful - maven

I got a project written in java EE 5.
I use:
Java 7
Maven 3.5.4
idea 2018.2.5x64
When you build a project through idea, the project is not built.
enter image description here
But when I run the mvn package through console, the process completes successfully
Help me please for this issue.

Try to update your maven dependencies in Intellij. Usually you should see a prompt asking you to do that.
Read this for more details on updating dependencies: How can I make IntelliJ IDEA update my dependencies from Maven?

Related

spring boot: maven command to download all dependencies

In a spring boot project I would like to download all dependencies before starting the application.
When I run "mvn compile" first, it is downloading a lot of dependecies. But when I run "mvn spring-boot:run" after that, it still downloads tons of dependecies.
So what is the right way to download all dependecies like spring-boot:run does - but without running the application?
Thank you!
Try running maven with -o switch to run your maven command in offline mode. This will use already downloaded dependencies in the local repository.

How to deploy custom JavaScript rules in Sonarqube?

I recently happened to work on Sonarqube version 5.3. I installed it and the Sonar server is running fine, I even analysed some code and installed some plugins, but now I want to define some custom rules in JavaScript. I downloaded the sample code from Sonarqube website for custom rule in JS.
The downloaded folder has one pom.xml and src folder. I don't know how to deploy this custom rule, somewhere I read that I need to create .jar file and place it in "extension/plugins" folder. I am stuck here: I don't know how to generate .jar file.
You've downloaded the source code, which is a Maven Project, now you should build the plugin with Maven (mvn).
See SonarQube documentation on Building Plugins.
When you download the "javascript custom rule" project from https://github.com/SonarSource/sonar-examples/tree/master/plugins/javascript-custom-rules
You can see that it's a Maven project as it has pom.xml
Now you have 2 option to create .jar out of this project.
Option#1: Open this project in Eclipse and do "Run==> maven Clean" and then "Run==> maven install"
It will generate a .jar for you which you can see in Eclipse console.
Option#2: Open Linux terminal or windows cmd, ensure that you have maven installed. Go to the project path where pom.xml is there and invoke command: "mvn clean install"
It will generate a .jar for you which you can see in console.
Thanks !

How to update the version of Maven used by IntellijIdea

I try to open the Maven project in IntellijIdea. This project uses spark and scala. When I run:
mvn clean install -DskipTests
then it gives the error:
[ERROR] Failed to execute goal
org.scalastyle:scalastyle-maven-plugin:0.7.0:check (default) on
project spark-mllib_2.10: Failed during scalastyle execution: You have
50 Scalastyle violation(s)
I think that the problem is in the version of Maven. Indeed in IntellijIdea Settings I have the version Bundled (Maven 3) 3.0.5, while pom.xml defines <maven.version>3.3.3</maven.version>
If I run mvn -version in terminal, it points Maven 3.3.3
So, how can I update the version of Maven used by IntellijIdea?
Install the new version of maven (If not already installed)
Go to File -> Settings and use the search bar to find maven settings
Edit the Maven home directory setting so it points to the installation folder of the desired version
It may sometimes happen that after configuring maven in Intellij and changing as following it does not work by command build, so build it by Intellij maven tool.
Setting > Maven > Importer - select the JDK
Setting > Maven > Runner - select the JRE
After that, try to build by Intellij maven tool instead of Intellij console.

run maven project form github in eclipse

I have imported a Git project from this url to my Eclipse.
How can I run this project? I am not familiar to maven and javaEE. please guide me to run this project. I am confused.
I have installed eclipse javaEE Kepler. but i do not know how to configure this project to run? what is type of my run? maven build or junit?

Maven eclipse plugin error Lorg/sonatype/plexus/build/incremental/BuildContext;

Can someone let me know how to fix the same?.I tried to create a new maven project and it fails for some reason
Description Resource Path Location Type
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: Lorg/sonatype/plexus/build/incremental/BuildContext;
Have updated the maven-resource-plugin to version 2.6. It works fine with M2Eclipse integration v1.3 milestone.
My experience with eclipse and maven is not good I have been working for a long time with both and they don't integrate properly. The best way to make them work together for me was to use command line to build, package and install the projects and eclipse to edit.
To import the projects into eclipse I just use mvn eclipse:eclipse and it will generate the files needed to import the project into eclipse.

Resources