While making maven project I am getting "could not calculate build plan" plugins error - selenium

I am trying to make a new project in maven, but while making the project I am getting "could not calculate build path": plugins error because of this I am not able to work further.
Steps to reproduce:
Launch Eclipse (I am using oxygen) new version
Go to File ->New ->project->select maven as project option
Enter the required filed for POM file
Now, as maven project start building, I am getting the error.
Please find attached screenshot for the reference.

Try the following steps:
Make sure you have connectivity (you can browse) (This kind of error is usually due to connectivity with Internet)
Download Maven and unzip it
Create a JAVA_HOME System Variable
Create an M2_HOME System Variable
Add %JAVA_HOME%\bin;%M2_HOME%\bin; to your PATH variable
Open a command window cmd. Check: mvn -v
If you have a proxy, you will need to configure it
http://maven.apache.org/guides/mini/guide-proxies.html
Make sure you have .m2/repository (erase all the folders and files below)
If you are going to use Eclipse, You will need to create the settings.xml
Maven plugin in Eclipse - Settings.xml file is missing
You can see more detail in
http://maven.apache.org/ref/3.2.5/maven-settings/settings.html

Related

Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.3.2:test

Hello Team, Created munit from APIkit router ,while running a mule maven project along with munit, I am facing Failed to execute goal com.mulesoft.munit.tools:munit-maven-plugin:1.3.2:test (test) error ,without munit I can able to run the project successfully. My Studio version : 6.2.5 Mule runtime : 3.8.4 ,
Munit POM config
<mule.version>3.8.4</mule.version>
<mule.tools.version>1.2</mule.tools.version>
<munit.version>1.3.2</munit.version>
<mule.munit.support.version>3.8.3</mule.munit.support.version>
There could be a few things wrong with your set up:
Point to the correct settings.xml file
You will have a default settings.xml file in your project that you have to reference. Go to
Window > Preferences > Maven > User Settings
and point to your correct settings.xml file:
While you're there, make sure you have the correct 'm2-repository' configured as well (pictured above).
Point to the correct installation of Maven
Ensure that you are referencing the correct installation of Maven. Go to
Window > Preferences > Anypoint Studio > Maven
and choose the correct path to your Maven installation:
Make sure your build path is correct
Double-check your build path and make sure that it's correct.

IntelliJ Gradle "Unable to find Method"

The Error:
Failed to sync Gradle project '-'
Error:Unable to find method 'org.gradle.internal.logging.progress.DefaultProgressLoggerFactory.(Lorg/gradle/internal/logging/progress/ProgressListener;Lorg/gradle/internal/time/TimeProvider;)V'.
You can see, a constructor inside a class, which is found in the logging jar (gradle_home/lib/grade-logging-version.jar) is missing.
So, I think the Class-Path does not contain this jar file.
Gradle Version: 3.5
Running using the Command Line works.
I have already tried this:
Gradle sync failed: Unable to find method
to-find-method, it does not work for me.
I have tried to use different versions.
I can't see any difference when enabling
"Use default gradle wrapper"
"Use gradle wrapper task configuration"
"Use local gradle distribution".
I had the exact same problem today.
The only way I was able to get it to work was to remove my IntelliJ IDEA IDE, get the latest from the website (with JDK) and put it in a new folder (i.e. no overwriting existing files).
After that, I deleted the .idea folder from the project and reimported it cleanly into the "new" IntelliJ.
I suspect upgrading IntelliJ from Version <= 2016.x caused the issue, since a new installation / clean extraction from archive caused it to work on the fly.

Where is the war file built in Intellij IDEA, located?

I'm using IntelliJ IDEA and I'm building and deploying the web-application project every time I'm running it. All of this happens magically within IntelliJ IDEA.
However, now I'm supposed to manually deploy it on a test server's wildfly, so I need an artifact file (WAR or EAR) to drop in the standalone/deployments directory on the test server's running WildFly10.
I can't for the life of me find where IntelliJ Idea exports the WAR / EAR artifacts so I could copy paste it to the said directory on the test server. Any help is appreciated.
Please follow the steps :
Click on Edit Configurations.
Click on Deployment and add your artifact.
Apply these changes.
You can see a Build Artifacts under Build.
Click on Build Artifacts and it will create a war/jar to the respective folder.
If I'm wrong somewhere let me know.

IntelliJ Spring Boot: How to create an executable jar

I'm trying to create an executable jar from IntelliJ.
First I got the Java Security Exception and I changed sqljdbc4-4.0 to unsigned. First problem solved.
Then I got Manifest not found. Added META-INF dir to output. Second problem solved.
Next I got the BeanCreationException (unsolved):
Caused by: org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath.
In IntelliJ it is working.
I think the resources are not in the output. (application.properties, ...)
In which way do I add the resources or where are they stored in the jar.
I'm using gradle and on the spring boot homepage are only instructions for maven.
You should use spring-boot-maven-plugin or spring-boot-gradle-plugin, depending on your preferred build system.
EDIT:
Just run ./gradlew build
I suggest to dive into this getting started guide. It clarifies a lot of stuff for beginners.
A typical Spring boot project is a Maven project or a Gradle-Project (I only know how to do it with Maven, for Gradle see [luboskrnacs answer][1]). So you just need to run the maven targetpackageand pick the jar form the (created)target` folder
use a shell, go to the project root directory (where the pom.xml file is) and type
mvn clean package
cd target
the there is the xxx.jar file.

Invalid JDK configuration found, while importing a project via Gradle

I have installed IntelliJ and I need to import a Gradle project.
I have build the gradle project using command prompt with the gradlew build command.
At the IntelliJ welcome page, I have proceeded with proper instructions, and when I choose "Finish". I get the following error:
Invalid Gradle JDK configuration found. Open Gradle Settings JAVA_HOME ennvironment variable not set.
When I click on "Open Gradle Settings" it pop up with error of Not found with a path under IntelliJ directory in Program files and searching in jre/jre/bin/....etc.
Deleting .gradle and .idea will likely solve the problem.
So:
Close the project
Go to the project dir and delete .gradle and .idea
Get back and re-open the project using the IDE
These two must be generated locally on your PC (Some content of .idea might be version controlled though) and not pulled from a remote or somewhere else (Also they should be in .gitignore).
In my case the reason was that these two folders were generated on another computer and I had opened a project with these two folders existing before.
Just found the solution :
Create an empty Gradle project, then go to "Project Structure" and check the path to JDK (it should be valid, if it isn't you can add your own path).
Then build this empty project, wait and once done, close IntelliJ.
Relaunch it and try to import/open your Gradle project, now it should work.
You don't need to create a new project to fix this. You can do it from the main window (Configure -> Project Defaults -> Project Structure):
Then, on SDKs, set the appropriate JDK home path:
If you are on a Mac, click on the button with 3 dots and select the folder /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home.
I've found this here:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000266650-invalid-gradle-jdk-configuration-found
Mac OS X Solution:
I had the same issue and fixed it by setting the JAVA_HOME environment variable using the command:
launchctl setenv JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/
Refer to this answer on how to set environment variables in Mac OS X:
Setting environment variables in OS X?
Close the project
Go to the project dir and delete
.gradle
.idea
Get back and re-open the project using the IDE
I recently had the same problem while importing a Gradle project. The trick was the remove the quotes from the JAVA_HOME variable. So instead of "C:\Program Files\Java\jdk1.8.0_66" my path now contains only the plain path C:\Program Files\Java\jdk1.8.0_66.
To add to the previous responses, if you want to prevent this problem when cloning a repository in Git, you can simply remove .idea/misc.xml from your .gitignore file. This contains information about the project jar. For example:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
For my case, I just restart the IDE and it works. It automatically download Gradle to suit the project version.
I had the same problem on the fresh installed Windows OS.
I did not have a JDK at all and forgot to check it invalid JDK configuration .
By default, you can check the Project configuration. If it is empty NO_SDK_ProjectStructure try to download JDK from Oracle web site and configure your project structure
I have faced same problem for tomcat 9 with my project based on Gradle.
You can easily rectify the problem by configuring the application.properties file with the following code.
location - src/main/resources/application.properties
server.port = 9090
spring.security.user.name= admin
spring.security.user.password= password
My issue was not addressed by the above solution, instead root cause was that I've imported settings from my old system and internal Intellij configuration was invalid because first jdk that it had in the list in jdk.table.xml pointed to a wrong path.
To fix this you should find this file in the intellij config folder and then simply open it with an editor and remove whole block related to the bad jdk version.
Close the project you are working on and then create another new project and build it and then close it and go back to your old project and it will work.
Comment this code on gradle.properties, the Issue was gone.
#org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home
I was getting:
Invalid JDK: /home/sz97/idea-IC-223.7571.182/jbr/bin/jlink is not a file!
Ensure JAVA_HOME or buildSettings.javaHome is set to JDK 15 or newer
As mentioned by Mahdi-Malv, delete .gradle & .idea folders from the project directory.
Then delete other SDKs from File > Project Structure > Platform Settings > SDKs keeping the only required one.
Finally change the SDK version from Project Structure > Project Settings > Project.
This may solve the problem.