Intellij not picking up maven surefire configuration - maven

In my surefire configuration I have a classpathDependencyExcludes entry.
For some reason Intellij does not seem to pick up this configuration (mvn test, does). Is there any way to have Intellij notice my surfire configuration?
Ps.
It seems like something similar has been reported a long long time ago at Intellij ( IDEA-52286 ), but never fixed.

Both IDEA-101185 IntelliJ does not use systemPropertyVariables defined in maven-surefire-plugin configuration and IDEA-122783 Unit test runner ignores maven surefire classpath configuration have been already fixed.
But IDEA still ignores properties from systemPropertiesFile.

Related

ArchUnit: How to get gradle to execute the tests?

I have a gradle project where I've added the archunit-junit5 dependency and written some test classes with #ArchTests. These get picked up by IntelliJ.
How do I get gradle to execute them?
I've found the com.societegenerale.commons:arch-unit-gradle-plugin but that seems to need configuration in the gradle file.
I just want gradle to pick up the tests I already have in the test/java directory.
Gradle should pick up #ArchTests with archunit-junit5 if you useJUnitPlatform().
https://github.com/TNG/ArchUnit-Examples/tree/main/example-junit5 shows a quite minimal working example.

maven plugin execution issue

I am using aspectj in a project. when i add the aspectj-maven-plugin to the build, the aspects are woven in and things work as expected. however, i get an error in the POM saying that the plugin execution is not covered by lifecycle configuration.
from what i've read in other problems, it says the solution is to simply wrap the plugin in a pluginManagement tag. that does seem to get rid of the error, however, when i do a mvn clean install, the aspectj plugin no longer runs. any idea on how to solve that problem?

Different classpath between IntelliJ and mvn

I am trying to run a Junit test from Intellij, which is failing. The same test is succeeding if I use my terminal and mvn.
I noticed that the classpath used when Intellij runs the test is different from the classpath that mvn test uses. I believe this is causing some conflicts during the execution in Intellij and causing it to fail.
Versions:
Maven: 3.1.0 Same maven is used by Intellij and Terminal
Java: 1.6.0_65 both by Intellij Module and maven
Anyone has any pointers on how to resolve this?

IntelliJ runs unit tests with Maven instead of JUnit

I have some Unit tests, that when I try to run, it automatically creates Maven run/debug configuration, instead of JUnit (the integrated IDEA tab).
For some tests it does use JUnit run\debug configuration and manually - I can create both Maven and JUnit.
How do I make JUnit to be the default test runner ?
The problems is that I had maven runner plugin installed, causing all my tests to run with Maven
You can use the maven option "-Dskip=true" to suppress the maven test execution, and you can add your own test configuration to the build process. This screenshot was taken form IntelliJ 15.0.2.
Update: maven option

How to pass '--list-config' to Jetty when using maven jetty plugin?

We can pass arguments like '--list-config', '--list-classpath', etc. when using Jetty's start.jar as shown at http://www.eclipse.org/jetty/documentation/9.2.8.v20150217/startup-classpath.html and http://www.eclipse.org/jetty/documentation/current/startup.html
I was wondering how could I pass them on while using Jetty Maven plugin. I tried < jvmArgs > and run-forked but that didn't work.
jetty-maven-plugin is just an embedded-jetty for Maven plugins.
It is unrelated to the jetty-distribution's start.jar standalone operation.
For the jetty-maven-plugin there is no Server Classpath, just the maven plugin's own Classpath, determined by maven, gleaned from the effective pom (pom hierarchy) of your maven build. Use maven's --debug to see the plugin classpath during the execution of that plugin's phase (note: the classpath can change between different phases)
The configuration is also part of the phase that the jetty-maven-plugin executes with. Again, use the --debug from maven to see that configuration.
The configuration you see from start.jar --list-config is 100% in the scope of the start.jar determination from the configuration information starting at ${jetty.base}/start.ini, and the selected jetty modules, along with your properties to build up a Jetty instance, a "pre-start" configuration that start.jar will execute to build up a Jetty instance.
Its like you are asking how to understand a bicycle (jetty-maven-plugin) by looking at an technical specifications manual for motorcycle (start.jar). There is only inconsequential overlap between the two: 2 wheels of approximately the same size, with handlebars, and a seat.
Yes, the differences between jetty-maven-plugin and start.jar configuration and startup are that vast.

Resources