Intellij Doesn't Honor maven-compiler-plugin - maven

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?

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.

OSGI plugin development with Domino Designer 10

Up to date I was using IBM Domino Designer V9.0.1 FP8 to develop an OSGI plugin. With this version everything was working as intended. I've created a plugin project, a feature project and an update site project. Selecting "Build all" in the update site project created all the the corresponding jar files.
Today I've installed IBM (HCL) Domino Desinger V10 FP2 (fresh install i.e. I've deinstalled V9.0.1 and deleted the old "workspace" directory in NotesData, but I kept the NotesData itself).
Now if I open my plugin projects, I can edit the plugin, save the Java classes without any errors. Up to this point everything is working as usual. But now, if I use "Build all" in the update site project I see a screen with "generating ant script" and then the build process is finished, but no jar files are generated.
Any ideas why this is happening? Am I missing some files? Am I missing some configurations?
BTW: if I use standard eclipse to build the plugin all jar files are generated.
Domino Designer is a customised version of Eclipse. 9.0.1 FP9 and lower is a very old version of Eclipse, 9.0.1 FP10+ is a much newer version, so not comparable to what was happening before. It's possible there are differences in the customisation of Eclipse that are affecting it. But every Domino OSGi plugin developer I'm aware of uses standard Eclipse.
Follow the steps for setting up your environment here https://github.com/OpenNTF/XPagesExtensionLibrary/wiki/Development-Environment. In the documentation there I've tried to document why steps are done and what they achieve, as well as just the steps themselves. The intention is to pass on understanding to a broader set of developers, for future proofing.

Why Intellij IDEA skips Maven test

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.......

How to clean plugin dev cache in Intellij

I have a question about plugin development and IntelliJ. I'm developing a plugin to IntelliJ 12, and I have attached community sources. When I try to run my plugin (which has it own configuration under File → Settings → MyPlugin) and I check if configuration is visible, I don't see it. I know that it is working, because on another PC I checked it and configuration is visible (I didn't run the plugin earlier, it was first run, and configuration was visible).
I think that the IntellijJrun the configuration on the Community Edition which I have attached and on computer where I didn't saw configuration, I ran plugin few times before I have added that configuration.
When I run plugin, I see the message that cache wasn't cleared, and I think that this is the issue why I don't see configuration under File → Settings.
So the question is: how can I clear the cache on the testing instance of IntelliJ? I read that in IntelliJ 13 there is an option under File menu, but in 12, this option is not available.
I found a solution. If someone will want to clear their plugin development cache in IntelliJ 12, go to: USER_HOME\.IntelliJIdea12\system and remove the plugins-sandbox folder.

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