Why Intellij IDEA skips Maven test - maven

I use IntelliJ IDEA version 13 on MacOS. I have a maven project, the project is stored in Git. Everything worked well.
Yesterday my Macbook crashed, then I reinstalled MacOS as well as IntelliJ IDEA. After that I checked out my project from Git and open the project in IDEA again. But now In Maven Project's Lifecycle, test is disabled, there a dash across test. I can still package my project, but "Tests are skipped".
Since my project code has no any change, I'm guessing I might miss configured something in IntelliJ IDEA. Any idea?

There's a skip test toggle in Maven Projects tool window.

To enable the maven Test, these are two steps need to complete
Step-1: Go to the settings tab, then go to Build, Execution, Deployment
Step-2: Then select the testing, and uncheck the Enable test runs.......

Related

Netbeans 11 Gradle Project does not run gradle on save

I have just installed Netbeans 11.1 and when I save one of my Java files, Netbeans does not start a gradle build automatically. This used to work in Netbeans 8.2.
I have installed nb-javac and have also tried the newest Beta version to no avail.
Is this a known bug or do I need to reconfigure something when going from NB 8.2 to 11.1?
(This is only an explanation rather than a solution to your problem.)
First, Compile on Save is an option which is set or unset at the individual project level, rather than at the global level. So for a NetBeans Gradle project, select Properties > Build > Compile to view the setting for the Compile on Save checkbox. For that checkbox, note that:
It is unchecked by default, so there will not be an automatic Gradle build when you save a project file.
It is disabled, so you cannot trigger a build whenever you save a project file.
The problem persists in the latest beta of NetBeans 11.2.
I don't see a bug report for this issue, so perhaps you can raise one? Click the Log In button to sign up first if necessary.
That said, there is a related issue which may explain why the check box cannot be enabled. See closed bug NETBEANS-680 Erroneous Gradle Compile-on-Save activity which relates to Gradle projects using version 9.0 of NetBeans. Apparently there were spurious and unwanted compile-on-save runs being triggered even though Compile on Save was unchecked. Perhaps the feature has been deliberately disabled for Gradle projects because of that issue, though that is just speculation on my part.
Also see the GitHub page for the Gradle plugin. Comments from the NetBeans team for NETBEANS-680 suggest that the problem was with the plugin rather than NetBeans. That said, if NetBeans is offering functionality that cannot be enabled (i.e Compile on Save), it is definitely a NetBeans issue regardless of the underlying cause.
Finally, note that you can configure the Gradle plugin using Tools > Options > Java > Gradle, but I dodn't see any options there that would help with this issue.

Intellij IDEA 2019.2: Set the maven home directory "globally" for all projects

Every time I clone a repo I have to manually set the maven home directory under File->Settings->Build, Execution, Deployment->Build Tools-> Maven-> Maven home directory which is very annoying. I searched jetbrains forums and there is only an option to configure the IDE for FUTURE projects which under circumstances can never be a fact. Cloning a repo into idea projects is not creating a new project and therefore the global settings do not get triggered. How can I do this? Btw it not only applies to Maven home dir but also Code Style settings and many other more - see here
IntelliJ IDEA doesn't have a feature to propagate any setting to all the existing projects. A request is welcome.

how to debug spring boot gradle projects faster in intellij idea?

When I develop spring boot gradle projects in intellij idea, if I want to change some code and restart the project, I have to click the Make Project menu item and this will trigger a gradle build.If the gradle deamon is dead, it will start first which is an upset process.
While in Spring Tool Suite, everything is so easy, just Ctrl S and STS will restart immediately witout the long gradle build. So is there any way to make intellij idea restart faster?
I know if the gradle deamon is alive, gradle build in intellij idea is not very slow and is acceptable. But on my computer, the deamon can usually live for only several minites. When I change some codes and want to see the effects, the deamon died. I have to start the deamon every time! Is there any other ways to make the deamon live longer?
Thanks a lot if there is any useful tips!
Well, thanks to #Gregg and #CrazyCoder 's comment, I found some useful links:
Developing/Debugging a Gradle-built Spring Boot app in IntelliJ IDEA
I accidently enable the delegate to gradle option in idea, which will trigger gradle build instead of idea's build, which is faster than gradle's. So disable the delegate to gradle option is a choice.
From another post, I get some idea to use the continuous build in gradle: open a terminal and run gradle assemble --continuous, when files are changed(for example save files or defocus window), gradle will compiles files automatically. Then run the spring boot app use gradle bootRun or from the tasks in idea, everything is ok. But this way will start two gradle so ram usages are larger.
Update:
I found another way to automatically compile. Fisrt, enable build project automatically option, then use ctrl shift a and input registry to open a dialog, and then enable compiler.automake.allow.when.app.running opiton. Finally, project will compile automatically and spring boot will also restart automatically.

Intellij Doesn't Honor maven-compiler-plugin

I have 3 JDK's installed on my computer and Intellij knows about all 3 (6, 7, & 8)
Most projects I work on need 6 but a few need 7 or 8 (we are slowly moving everything to 8)
Maven supports this just fine with the maven-compiler-plugin configured just like here:
http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
This works fine from the command line. However Intellij doesn't listen to that plug in and seems to use what it thinks is right. (by default it always goes with Java 8 because it's the last in the list I think)
Is there a way to force Intellijs compiler to use the plug-in? Or a way for everyone to share that configuration across machines and developers?
A few things might be happening, but IDEA should honor the maven-compiler-plugin settings. Have you re-imported your Maven project?
1.) Check to see if the language level settings are in sync, if you open up the Project Structure window (Ctrl+Alt+Shift+S) do the project AND module's language level mirror the Maven compiler's version?
2.) Now check your Run Configuration, hit Ctrl+Alt+A and type "Edit Configurations".
3.) Add a new Maven Configuration with the desired lifecycle phase, then open up the runner tab and deselect "Use project settings". Select your JDK from the dropdown.
4.) Click OK and hit Shift+F10 to run that new Maven Configuration. Does it work as expected?

How do I clear teamcity's maven dependency repository/cache

I have a teamcity server and I have maven dependencies which have changed but who's versions have not changed. From what I can tell this is causing my build to fail because teamcity is not updating these dependencies.
So I need to know how to clear out teamcity's maven dependency cache for my project. I looked through the documentation and didn't find anything significant.
Thanks!
Rather than trying to manually clear the local Maven repository on the server running Teamcity, it may be easier to force an update of the Maven dependencies in the Teamcity settings.
To do this, edit the settings for the Teamcity project (in the Teamcity frontend select the project and then select the 'Settings' tab). Next click the 'Edit Configuration Settings' link (top right) and then click the 'Build Steps' link on the right hand side. In here, edit the step responsible for compiling the code. On this form, in the 'Goals' field, add the argument -U (that's an uppercase 'U').
Save the settings and kick off a new build. That extra argument will force Maven to go and update its dependencies.
Going forward, if the dependencies are changing but their versions are not, you may be better to have their versions set as SNAPSHOT. See What exactly is a Maven Snapshot and why do we need it?
Found mine at /opt/buildagent/system/jetbrains.maven.runner/maven.repo.local.
I found mine in /opt/TeamCity/buildAgent/system/sbt_ivy/cache/, But if you can SSH to your machine, just run sudo find / -name "sbt_ivy" and you'll see the address of ivy in your machine (if you use SBT as I do)
You can actually go to Version Control Settings and there is a checkbox "Delete all files in the checkout directory before the build".

Resources