IntelliJ - Log4j2.xml <Configuration> "Wrong root element" - intellij-idea

IntelliJ IDEA 2022.2.1 Ultimate Edition
When I open log4j2.xml file in a project that is working fine with Eclipse, IntelliJ complains about tag with error "Wrong root element"
What is the reason and how to resolve? The tag is correct from what I read from log4j2 site https://logging.apache.org/log4j/2.x/manual/configuration.html

Related

Intellij - No valid Maven installation found when configured to use Maven Wrapper

I've upgraded my IntelliJ Community from 2021.1 to 2021.2 today and now I'm getting the following error when trying to run maven commands:
No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.
But it's correctly configured to use Maven Wrapper:
My .mvn/wrapper/maven-wrapper.properties is as follow:
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
What am I supposed to do in order to keep using Maven Wrapper? Or is it a possible bug?
It is a bug: IDEA-258757 Cannot start tasks with maven wrapper
UPD: This is fixed in versions 2021.3+

IntelliJ checkstyle plugin installed from disk with "Could not determine plugin directory" error

I just installed the checkstyle plugin from disk in IntelliJ by navigating to the jar which is just in the directory that it was downloaded to. When I restart IntelliJ to have the plugin take effect I get the following error:
2:50 PM Unexpected Exception Caught
The scan failed due to an exception: Could not determine plugin directory
org.infernus.idea.checkstyle.exception.CheckStylePluginException: Could not determine plugin directory
at org.infernus.idea.checkstyle.CheckstyleClassLoader.getBasePath(CheckstyleClassLoader.java:173)
at org.infernus.idea.checkstyle.CheckstyleClassLoader.buildClassLoader(CheckstyleClassLoader.java:94)
at org.infernus.idea.checkstyle.CheckstyleClassLoader.<init>(CheckstyleClassLoader.java:69)
at org.infernus.idea.checkstyle.CheckstyleProjectService$1.call(CheckstyleProjectService.java:69)
at org.infernus.idea.checkstyle.CheckstyleProjectService$1.call(CheckstyleProjectService.java:64)
at org.infernus.idea.checkstyle.CheckstyleProjectService.checkstyleClassLoader(CheckstyleProjectService.java:117)
at org.infernus.idea.checkstyle.CheckstyleProjectService.getCheckstyleInstance(CheckstyleProjectService.
I am on IntelliJ 2018.1 and the most recent version of the checkstyle plugin. Is it claiming it is unable to find the directory where the checkstyle plugin jar is even though I just installed it by pointing it to that directory? Do I need to move the jar to some kind of plugins directory? I'm following the guides I found online and they do not mention having to do anything besides what I have already done.
Nevermind. I was pointing to a particular jar file instead of the zip file for the whole plugin. Installing from disk and pointing to the zip file instead fixed the issue
This worked for me:
Uninstall the plugin and restart Intellij
Reinstall the plugin pointing to the zip file as originally downloaded from https://plugins.jetbrains.com/plugin/1065-checkstyle-idea
Restart Intellij

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 could not find resource directory

I had been used log4j2 with the same configuration on my other projects but in this project, Intellij could not find resource directory.
I created resource directory and marked it as Resource Root.
Here is an image that shows my project structures.
But I got below error.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
I had tried to rebuild project and restart IDE, with no success.
I'll be appreciated if somebody helps me.

intelij always returns 404 for find jar on web

I always get an 404 error in intelij ide when I try to "find jar on web". The following appears:
And I can't find a way to change the urls intelij is using. I don't use a proxy.
How to configure this to make it work?
As described here, you may open the Project structure (⌘+; on mac or Ctrl+Shift+Alt+S on windows). Go to Libraries pane on the left and click on the + button and choose "From Maven..."
Provide the correct Maven URL for the jar that you need in the resulting dialog.
Screenshot from Intellij 15.0.1: