I use to use IntelliJ, lately I have updated to IntelliJ EAP now the checkbox "Import Maven projects automatically" has dissapeard , so every time I add a new dependecy I need to do it manually.Is there any other way or work around to have this checkbox visible again , or to enable auto import?
Thanks
Search "Enable auto-reload after any changes" in the action dialog.
They have renamed and relocated the functionality to the Maven tool window as a control with the latest version.
By following ways you can Import Maven projects automatically:
For InteliJ IDEA 14 upwards:
Click Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing -> TICK "Import Maven projects automatically".
For InteliJ IDEA 2020 upwards:
Click Settings -> Build, Execution, Deployment -> Build Tools -> TICK "Reload projects after changes in the build scripts" and "Any changes"
"We’ve also removed the option to enable/disable auto-import from the settings, as the improvements mentioned above have made it redundant."
https://blog.jetbrains.com/idea/2020/01/intellij-idea-2020-1-eap/?_ga=2.209144210.1862481759.1584865190-1304159286.1579103926#maven_and_gradle_importing_updates
They have added now in build tools -> select Any changes for reload project after changes in the build scripts.
Press ctrl + shift + a to open the "actions" dialog.
From there, type "import maven projects automatically". Click that option and it should work.
Related
If I define a maven config in "run as->run configurations" and then set one up, how can I then make it appear in the right-click -> 'run as' options?
Or failing that, where can I make the run configuration appear where it's not so buried in mouse clicks?
The moment you convert your project into Maven through rightClick-->configure and then update maven project you can automatically see maven clean in Run as option. From there you can build your project
I have eclipse oxygen with M2E installed. I usually update my dependencies via Right Click -> Spring Tools -> Update Maven Dependencies. This uses Resolve Workspace Dependencies by default which I don't want.
How can I turn that option off by default?
For now I have to use command line with the command mvn eclipse:eclipse which one should not be using anymore
Note: My projects are not maven projects within eclipse
If you right click and go to Maven -> Update Maven Project you should be brought to a window. At this window there will be an option to select the code bases to update as well as not forcing update of snapshots or releases. This should help you get around this.
EDIT: The question has been edited to point out the projects are not maven projects in eclipse. This answer is less relevant
I created the maven-spring project using the m2e plugin of eclipse. The project is working fine. I want to do a Maven build in Eclipse the project without using any commands in command prompt i.e. using the eclipse IDE only. But I am not able to find the option for Maven build from Eclipse IDE.
Below are the options I am getting when I right click on my project:
Kindly advise.
you can follow this link, right click maven project -> run as -> maven build..
http://www.tutorialspoint.com/maven/maven_eclispe_ide.htm
Right-click on pom.xml, then go to the "Run As" menu (not the "maven" menu). The various plug-in goals (and lifecycle targets) are documented here.
Is it possible to clean and build a java project in Eclipse with one click? I don't want to go to Project -> clean -> OK and than to project menu 'Build project'
In Project->Clean I select "Clean projects selected below", select my project(s) and check "Start a build immediately" with "Build only selected projects".
Then go to Window->Preferences->General->Keys, search "Build clean" and enter my own binding for this command. For example, Ctrl + D.
Then, when I press Ctrl + D and Enter I have clean and build.
When you have
Project --> Build Automatically
checked, it will be automatically rebuilt after cleaning it.
If you need something more powerful than clean and deploy, I suggest to learn Ant build tool.
http://ant.apache.org/
Just configure it for your project and prepare the build script, than configure the build script for the clean and build target. If you need, also to deploy it on your server (glassfish, weblogic or whatever you want). With Ant you can configure more situation (test, production..)
Select your project and goto menu bar:Select Windows then->Select Preferences then ->Select Keys then ->Select Build and Clean
Just need to Ctrl + S then Build, it will be as good as new!
I have an eclipse project structure that looks something like this:
eclipse
project a
project b
All of these projects are Maven projects. Project B is an Eclipse WTP project and contains Project A as a dependency. I'm using the m2eclipse plugin.
When I deploy Project B to Tomcat (all from within Eclipse) it always throws errors saying that it can't find classes from Project A. The only way I can resolve this is to close Project A in Eclipse and do a mvn install command, so at this point Project A is treated like any other dependency.
I would like to not have to keep reopening and then closing Project A every time I make changes to it (which is pretty frequently at this stage).
I have tried adding Project A to Project B's Build Path, however that doesn't seem to do the trick. Again, it only works if I close the project in eclipse so it's treated like a normal maven dependency.
FYI I'm using the Helios version of Eclipse. Project B is a Spring project, so naturally Tomcat falls over when it imports all the beans etc.
Does anyone have any suggestions? Thanks a lot.
What you need to do is this:
In Eclipse go to Window > Show View > Servers > and open tab called Servers
In Servers, double click the server you want
This action should open a window entitled Overview, with your selected Server in the TAB
In this window select: Open launch configuration, and click the link.
In the Edit Configuration window, select the tab called Classpath
In the ClassPath textbox, select the line: User Entries
Now push the button on the right entitled: Add Projects
In the resulting Project Selection window select the external project you want the server to find via click.
Close these windows by clicking Apply then OK as appropriate as you work up the stack
Restart your server in the Overview window
You should be ready to go. It's actually only a 2 minute exercise. Good luck
If you go to the project properties, pick the item "Deployment Assembly", click "Add..." and choose "Project", you can add the dependent project and the issue should be solved.
The reason that tomcat cannot find your classes is that the project dependency in eclipse is not seen by tomcat. To resolve the issue you can add the bin folder of project a to the tomcat classpath of the app running from project b.
Right click on the web project which is added to container server and select Maven and then select Disable Workspace Resolution. Then your dependency project will start appearing as a jar like any other dependencies.
Right Click on the WebProject --> Maven --> Disable Workspace Resolution.
Have you installed the m2eclipse extension that know about WTP? Without it m2e will not work correctly for WTP projects. See this:
https://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto
Simple way :
Run -> Run Configurations... -> Classpath