IntelliJ run configurations for Netbeans RCP project - maven

there's a project I'm working on with a team (BUMMEL) and we've migrated it's build tool from Ant to Maven, to make it IDE-agnostic, and now I can open it into IntelliJ as a Maven project but I have troubles creating the run configuration for it.
Can anyone suggest me how to create a Run configuration? Also any other suggestions about running NetBeans-RCP maven-based project on IntelliJ are appreciated.

It looks like you should go to Edit Configurations... and add new Maven configuration.
Then put in Working directory: field a path you your app module, for me its application/ in the project root.
And in Command line: field put nbm:cluster-app nbm:run-platform.
Now you can run your app by selecting a newly created configuration and pressing a green "Play" arrow.

Related

Springboot not recognized on IntelliJ

Even after installing Java and Maven, creating a spring project from springinitializr is facing an issue. The issue is that the project is not recognised as spring project, the annotations, import nothing are working. Can anyone please help out
I tried to redo the process, but things were same. Is any settings.xml needs to be made but I don't see it as necessity.
When opening your project in intellij. you should do so via the import > new Project and choose the pom.xml for the generated project from spring initialize. This way it can resolve dependencies and properly open your project.
if the problem persists you can go to your MainApplication.java > right click > run as spring boot project.
If it does not put the configuration on the run shortcut on the up right of the application you can configure it by adding the command : mvn spring-boot:run and add other configurations id desired.

How to run a spring boot application in intellij?

I am trying to run a spring boot application in intellij 2020.1.1 idea by first generating from spring initializer in start.spring.io then open it with intellij. But when I try the application it doesn't have any output.
Can anyone help me with this? Is this a problem of windows defender?
Try opening the project using the pom.xml file (instead of the project map). File > Open... > select pom.xml
Trust the project when asked.
Run maven when recognized as a maven build.
(Right now there is no maven tab on the right.)
When the maven build is recognized a *.iml will be created and a project configuration will be added to your configurations.
Now you can just press 'run' at the top (or press shift + F10)
Tip: you can also just drag and drop pom files on the start screen and it will open the project.
Click on the run button in Main Class. It will automatically start your project. It worked for me.

How do I run the Spring RESTful Web Service

I've installed the spring example RESTful Web Service. And I have it building fine in IntelliJ. But how do I get IntelliJ to create gs-rest-service-0.1.0.jar? There are menu commands to synchronize gradle & maven, but nothing to use them to build the jar.
A standard POM/Maven-based project can be built via the console by typing:
mvn package
the maven lifecycle, by default, will place the output artifact (i.e. JAR / WAR file) under the target folder.
Alternatively, since you are using IntelliJ, you can also use the IDE to run the build for you. The simplest way is to navigate on the right side tab
mvn > your_project > lifecycles > package
the output will continue to be placed in the same target folder.
Assuming the project has a pom file. And it was mentioned building fine in the post. Assumption: STS/Eclipse users
Right click on pom file -> run as maven build. In the console it displays where the jar file is created.
Go to: project folder -> target folder -> gs-rest-service-0.1.0.jar
file

Importing to IntelliJ - Error package org.springframework.boot does not exist

Dear Stackoverflow Community, I have the following problem with my spring boot starter application. I imported the starter project as a new maven project into IntelliJ. But IntelliJ does not find the dependencies I specified in the pom.
Image of my Application Class:
If I try to run the project I get the following error message.
Image of the Error Message:
I already tried everything from re-installing IntelliJ to re-importing the project or redownloading the dependencies. I simply dont know why IntelliJ doesn´t find the dependencies.
My pom.xml looks as following
Image of my pom.xml:
The first time I tried to edit the pom.xml it said to me "this file does not belong to the project". Maybe this might be one reason.
Running the whole thing with 'mvn install' or 'mvn clean verify' works.
Try this and then build: mvn -U idea:idea
Had the same problem. I have tried everything: invalidating cache, deleting the whole .m2 folder, changing settings, reloding the project, nothing helped.
The solution for me was to delete the .iml files which are IntelliJ module files used for keeping module configuration. After reopening the project it worked.
The idea was not mine, I found the hint here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/203365204--package-does-not-exist-error-despite-autocomplete-being-aware-of-them
Sometimes your workspace could get corrupted.
In my case, I tried to Reload the project and it worked
in my case changed JDK version in Maven importer from JDK 11 to my local JDK version 1.8
Here is how my IntelliJ settings for spring boot application looks like
Click open -> browse your workspace -> and select POM.xml file
Check this in your intelliJ settings
Do this too [Settings --> Maven --> Importing]
I just had the same issue. My solution was to remove all dependencies from the pom, reload via maven -> Reload All Maven Projects. Run mvn compile. Add dependencies back to the pom, maven -> Reload All Maven Projects. Run mvn compile.
Now the Intellij build works.
You need to change Maven's JDK for importing option from Project JDK to the Path variable for Java on your machine.
You can get to this by going to Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing. Scroll down to the bottom and look for JDK for importing:. Select from the list the path variable for JAVA.
For Windows users, JAVA_HOME should be an option in the drop-down list.
Follow these steps, your problem should be solved. You just need to add Spring-framework-starter-web and Spring-framework-starter-tester from your pom.xml file.
Got to generate(ALT+Insert)
Add dependencies
Search "springframwork"
Add...
Here is the link
In my case, adding the project as maven project helped .

run maven project with eclipse

I'm new to maven and eclipse. I added m2e-plugin in eclipse and I imported an example of a maven project that I've found in the net.
My problem is when I try to run the project in eclipse using the Run as item menu, I don't find the maven package menu as I learned in the different tutorials.
Is it a problem of installation?
Ok, lets go through this step by step to make sure you have everything you need to get going.
First of all make sure that you have Maven installed (and lets assume you have Java already). You can download it from http://maven.apache.org/download.cgi and installation instructions for Fedora (which I assume is what you are using from your tag) are further down the page.
To test that Maven is correctly installed and working type mvn --help in to the terminal. Eclipse and m2e pretty much just hop on to the terminal for everything Maven related so make sure this is working before proceeding.
Next download an appropriate version of Eclipse. For the sake of this example I've downloaded the Kepler version of the Java EE IDE. In this version of Eclipse m2e comes bundled and to check this you can go to Help > About Eclipse > Installation Details and on the plug-ins tab you should see the m2e connectors.
Now you can import your Maven project in to Eclipse. To do this go to File > Import and then choose Existing Maven Projects under the Maven section. Choose the directory with the example project that you've downloaded and then Finish.
Now, ensure that you have some file inside your example Maven project opened and when you go to Run As... you should now be able to see the maven options. Go to Run As > Maven build... and all you need to do is place the word package in the Goals field and you're ready to roll.
Convert your project to a maven project if you haven't done yet by right clicking on your project in the Eclipse Project/Package explorer. Then follow:
Configure -> Convert to Maven Project
After that you can just right click again on the project Run as and you will see all Maven possibilities to execute your project build/install/clean etc.

Resources