Error raised while performing clean install in maven (IntelliJ) - maven

cannot access default field of properties
I tried to clean and reinstall and also manually tried to override plugin in Pom.xml

In the right sidebar, you will see the maven tab:
click it -> you'll see something like in the picture -> click on generate sources (the second top icon)

Related

How can I remove a dependency from IntelliJ which I added through pom.xml?

I added Spring Security to my dependencies in the pom.xml and IntelliJ IDEA then downloaded it. I checked the http://localhost:8080 and got redirected to http://localhost:8080/login.
I now want to remove the dependency I added. I removed the dependency from the pom.xml but the login page is still there, and I can still see it in IntelliJ in the dependencies of Maven.
How can I completely remove the dependency?
When you made the change to pom.xml, a popup probably would have appeared at the bottom-right of the IDE saying:
Maven projects need to be imported
Import Changes       Enable Auto-Import
If you click 'Import Changes', you should find that IntelliJ reloads the POM file and removes the dependencies that you've deleted.
Assuming you no longer have that popup on the screen, you can achieve the same thing by opening the 'Maven' tab on the right-hand side of the screen and clicking the 'Reimport All Maven Projects' button (looks like a refresh button with two arrows in a circle).
You can also have IntelliJ do this for you automatically. If the popup mentioned above is still open, simply click 'Enable Auto-Import', otherwise open the settings and navigate to:
Build, Execution, Deployment > Build Tools > Maven > Importing
then select the option "Import Maven projects automatically".
IntelliJ IDEA caches files and dependencies.
Try to invalidate cache. as below -
Close intellij
Remove ...\home.IntelliJIdea14\system\Maven - cache for maven artifacts, you can
probably delete it.
Module and project informations are stored within the project - .idea folder and *.ipr
and *.iml files, you can delete them to be sure and reimport the project.
It is probably because it is loading the jar files from the cache location. You can clear that clicking on Reload All Maven Projects button present on the right hand section of screen, under Maven as shown in this screenshot.
Once it is done, rerun your project. It should work as expected.

How to view maven dependency hierarchy in intellij

I can see the dependency hierarchy in eclipse, how can I do it in intellij ?
I also like the Maven Helper Plugin.
Allows you to see dependencies as a tree, see conflicts, search in them. It looks a lot like the Eclipse tooling.
Notice the Text and Dependency Analyzer tabs that appear at the bottom of the POM editor panel. Click the analyzer tab to see results as shown in this screenshot.
You can try:
Menu -> View -> Tool Windows -> Maven Projects
And then you can see new view openned.
Open your Dependencies tree, and you can see all the dependency hierarchy.
Offical documentation: View Maven dependencies as a diagram
Open the pom.xml, right click anywhere in the editor and choose "Diagrams > Show Dependencies".
It opens a dependency tree like those I'm attaching.
The main point is that this context menu appears only on opened pom.xml file (at least I couldn't managed to open it from anywhere else), if you just click on the file in the project tree, it won't be present.
Please note: You need to have UML Support and Maven Integration Extension enabled for this.
Use the shortcut Luke! Ctrl + Alt + Shift + U
Or select View -> Tool Windows -> Maven Projects
...here you can either:
A) expand the Dependencies sub-tree,
or
B) select the project ("spring-boot" in my case), a new icon reveals itself
Select Module or Directory and then Analyze from main menu
I love this plugin Maven Helper, but for some reason it was crashing my IntelliJ:
IntelliJ IDEA 2020.2.1 (Community Edition)
Build #IC-202.6948.69, built on August 25, 2020
I tried updating from the marketplace from within IntelliJ, but for some reason it didn't help.
I managed to solve this by installing it from the plugin website Maven Helper by clicking on "Install to IDE".
As mentioned #Ondrej Burkert the Maven Helper Plugin you can select the pom.xml file and if the editor is open there are two tabs at the bottom. First is 'Text' and second is 'Dependency Analyser'. In the tab 'Dependency Analyser' you have a tree of all dependencies like in eclipse.
Menu -> View -> Tool Windows -> Maven Projects is impractical and must be collapsed one by one. I prefer the plujin mentioned by Basil Bourque in this post.

How to get the Maven project window in Intellij 14 | Update: cannot see the right side "tab bar" with Maven project

I have a very simple question, but I Googled and somehow I couldn't find it. I was wondering how can I get the
in Intellij 14 or something similar?
I saw it in a tutorial, but couldn't find the panel. In my case when I followed this video exactly, I couldn't see the panel and I couldn't find it anywhere. I have IntelliJ 14.
UPDATE
I just experimented a bit with the Intellij interface but I can't seem to see the right hand side bar. See
I had similar problem until I right-clicked the option in POM "Add as Maven Project".
Notice: IDEA 2019.2 and I couldn't even find Maven in "Tool Windows" of the (existing) project before it.
First, make sure you have enabled maven plugin in
File → Settings → Plugins → Maven Integration
If so and still the tool window is hidden then
go to View → Tool Windows → Maven Projects to open it.
For those stuck with this issue, enable View -> Tool Buttons.
Finally found the solution, right-click on the pom.xml file (parent pom.xml if it is a multi-module project) and hit "add as a maven project".
You can find the Maven Projects pane by going to Help > Find Action or press Ctrl + Shift + A and type in "Maven Projects". However I can't see it anywhere in the elaborate menu's.
I had the same problem with a maven project, the tab wasn't showing up and even in the View->Tool windows menu, there was no maven item.
After searching the internet i could not find a solution but then i looked in Intellij idea
and noticed a Even Log showing a number in a red circle, i clicked it and then read an error message:
Non-managed pom.xml file found:
Add as Maven Project
check out solution proposed by invzbl3, It might help.
Simple solution to see maven on intelliJ is go to your right click on your pom.xml and then click on Add as Maven project.
Very simple. NO PLUGINS.
Maven comes by default so you should press two times the shift key and write "maven".
Then import the maven project ".pom" and the bar cames automatically after selecting the pom.
The question asked is how to show the sidebar, not show the Maven Plugin. On my version of Intellij this is enabled with the following:
View -> Appearance -> Tool Window Bars
if you have a pom file in your project, right click the file, click "add as maven project"
This got it back for me. None of the other solutions worked. I had no warnings for unmanged poms, toggling toolbars did not help and the maven option just where it should be anywhere!
It's a bit late, but I had the same problem with missing sidebars. At least in IDEA 2017.3 there is an icon on the bottom left of the screen that toggles the sidebars. That's how I got it back.
Right-click on your project > Add Framework Support > Maven
If View → Tool Windows → Maven Projects doesnt work that means tools button is deselected
go to View -> Tool Buttons and select it . You should be able to Maven window now
Try with File-->Project structure --> Modules-> Remove Parent/existing modules and add parent/all modules again
None above helped.
In my case I had to ad Java SDK. It keeps disappearing for some reason.
Right click on project folder -> Open Module settings -> Project in this window define SDK under SDK:
Maven toolbar appeared after doing that.
Weird but this works at times:
Disable File → Settings → Plugins → Maven Integration first and restart Intellij. Then re-enable it back and restart - this might fix the issue.
Enable maven plugin first in
File → Settings → Plugins → Maven
Also, make sure you enable Tool Buttons in
View → Tool Buttons
Check if at the bottom line of Intellij, it says "non-managed pom files found."
You can then "Add as a Maven Project"
Make sure your Maven plugin is enabled as well. In my case, it was disabled for an unknown reason. To enable it: Settings → Plugins → Installed (Scroll down to Bundled section)
If you not use Maven, can delete it.
open ProjectName.iml file in root of project of module.
then remove "org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true"" from file.
save and reBuild project.
Looks like my maven integration plugin got disabled.
Go to IntelliJ Idea --> Preferences
and enable Maven integration plugin.
Looks like Intellij Idea disables dependent plugin also, when one of the plugins are disabled.
Make sure that the home directory of the project is correct. I was creating Intellij project one level above the actual maven project folder and that's why the maven tool window wasn't showing.
No Need to do any settings i have attached the image of intelij in that marked area click on that multi window suport then you will be able to access the panels for all

How to download/attach source code in Intellij 12

I had created a new project in Intellij 12 version ,which is a maven module.I have selected autoscroll options from the IDE too.But when I hover to WebDriver using Ctrl Q it prompts me to download /attach source code.I tried downloading/attaching but no change shows and WebDriver.class opens up instead of WebDriver.java.
Also note that this is happening for my new projects only ,for old selenium version like 2.39.0 it shows fine,it prompts me to attach for only 2.41.0 selenium dependency.
Message that shows is "Source not found" in the IDE.Why is it only for 2.41.0 selenium version and not for 2.39.0?
In order to add sources choose:
1.File | Project Structure
2.Click Libraries tab
3.Pick library and click + icon
4.Find a JAR file containing sources.
But in your case,( using maven as a build tool), IntelliJ will automatically download and attach available source to all libraries, no manual work needed.
Update:
Feel free to do the following step to update the indexes so that idea know that we have done the above change.
File > Invalidate Caches/Restart -> click invalidate and restart

Invoking Actions other than Build and Clean & Build

I am new to NetBeans and am trying to define and run various custom goals for my Maven proj. My Maven proj uses a number of plugins; once for building the Java classes, another for pre-compiling JSPs, another for building an OSGi bundle, and another for deploying to my dev app server.
It seems that by default, NetBeans has Build, and Clean & Build as easily accessible "build options" in the main toolbar bar. These trigger the install goal which runs through the entire build processes (compiles everything and deploys to my dev).
In NetBeans, I can edit the Properties for the project, and define a "development" profile, and then define custom actions (or modify the default NetBeans actions).
How do I:
Invoke Actions that aren't Build or Clean & Build in NetBeans
Define only certain goals for specific plugins to run, and invokes those actions.
First go to the Project Properties > Actions and create your MVN build
The above will run:
mvn install -P initdb,initdb-qa -DskipTest=true -Dprop.name=dev
Then it will become available under "Custom"
This is really just a comment on #Ev0oD's answer, but I want to add an image so it has to be a separate answer.
After I created the toolbar button using:
Tools -> Options -> Java -> Maven -> Execution -> Edit Global Custom Goal Definitions
I then had to add the button to the toolbar using:
View -> Toolbars -> Customize (or just right click the toolbar header and select Customize)
I could then see the new button in the "Maven" group in this dialog:
I then had to drag the button onto a toolbar as shown. Note: Don't try to drag it to the blank part on the right of the toolbar header as this won't work.
If you want to use some custom goals on more projects and you want to have a quick access to them, you can use global custom goals, that are present in NetBeans 8.0.1 (not sure in which version they were introduced).
Access Tools -> Options -> Java -> Maven -> Execution -> Edit Global Custom Goal Definitions...
There you can add many of these and they will be present for all projects in the Custom section, as shown in the accepted answer.
A good thing is you can add it also to the Toolbar by clicking (Show in toolbar) and selecting one of six different colors of icon available. You will end up with something like this:
alternatively you can use the Custom popup on project node and within the Custom... action's dialog, setup goals for execution and eventually remember the setup for subsequent executions. The remembered item will appear in the same popup menu. For global (for every project) goal definitions, please see the global options.

Resources