Netbeans 11 Gradle Project does not run gradle on save - gradle

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.

Related

Why is Android Studio failing to build, with an AAPT2 error on images?

After a recent update, Android Studio fails to build an unmodified project with errors along these lines:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.1.1-6503028-linux Daemon #0: Unexpected error during compile '/path/to/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
Notice that it's failing on an image supplied by Android Studio itself!
What can I do to fix it?
This seems to be an error in the newest (newer?) Gradle plugin(s) when it comes to PNG images; Google's IssueTracker lists several newly reported bugs along these lines. One of them mentions that it's a Gradle issue; I made mine work by reverting to a previous version: Gradle Plugin 4.0.1 and Gradle version 6.1.1 work fine.
It will be necessary to ignore AS' nagging about a newer version until this gets fixed.
[Added at the request of #YinOrYan]
To revert to an older version of Gradle:
In the menu, select "Files", then "Project Structure..."
In the dialog that pops up, select "Project" (first item in my version).
You can select the desired versions of the Gradle plugin and of Gradle from the drop-down menus.
This should not lose any system calls, as this is different from the SDK or API versions. However, it's not independent of them, so there is probably a limit to where you can set them.
As usual you will want to be online when you first build, or whenever you have to import a dependency, but otherwise it should be possible to work offline.
Sadly, it looks like an issue with older architectures. While the team at Google is looking into fixing it, in the meanwhile you can still use the new Android Studio and AGP, but temporarily revert to using an older version of AAPT2:
Try locating the old aapt2 executable in your gradle cache, e.g.:
~/.gradle/caches/<subdirectories, hashes
etc>/aapt2-4.1.0-alpha03-6246747-/aapt2(.exe)
Once you have the path you can add to your gradle.properties file:
android.aapt2FromMavenOverride=path/to/old/aapt2
To make this a little bit more robust you can actually copy that executable to a non-cache location, in case you clean your caches and it dissapears.
Hope this helps! Keep an eye on the Issue Tracker bug for updates.
I also had the same problem with AAPT2 errors and I have got over it.
First, downgrades Gradle to version 4.0.1, or
Second, I have done is upgrading the AMD Athlon processor to AMD FX-4300 without downgrading the gradle plugin version.
Wow, that's a real show-stopper! Can you explain how you reverted to an older gradle in Android Studio. Is it possible to work offline after doing this. And, did you lose any of the new system calls as a result? All this going on after finally getting my code working with the new AR Core stuff...

Gradle compatibility between Android Studio 4.0.1 and IntelliJ 2020.2 IDE

Just an observation that AS4.0.1 no longer clobbers IntelliJ (2020.2) initiated project settings any more, and merely complains of 'unsupported Modules' being detected(Note *).
Is this the beginning of Détente with peaceful co-existence (I wouldn't want to be unhappily surprised in future)?
Just to give specific context, here is what I refer to: (both reject the last configuration - a failed hack) and utilise their preferred first or second one respectively: This is a GOOD thing)
From IDEA 2020.2:
Unsupported Modules Detected: Compilation is not supported for following modules: CalibSense.app.
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
The IDE modules below were removed by the Gradle project reload:
app
You can open DIALOG to select the ones you need to restore.
DIALOG LIST:
Android App:
[x]app
[v]Badroid.CalibSense.app (level: WORKSPACE)
[x]CalibSense.app (level: WORKSPACE)
From AndroidStudio 4.0.1(somewhere between IDEA 2019.2 and 2019.3):
Unsupported Modules Detected: Compilation is not supported for following modules: CalibSense.app.
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
DIALOG LIST:
Android App:
[v]app
[x]Badroid.CalibSense.app (level: WORKSPACE)
[x]CalibSense.app (level: WORKSPACE)
Suggested Update AS 4.1 (including - All improvements from IntelliJ IDEA 2020.1.4)
Note *: It turns out they both complain of an illegal configuration, not of each others working configuration.
Nope.
The problem is in a different version of the IntelliJ Platform. Android Studio and IntelliJ Idea is developing separately because it's different products of different companies.
Google adopts the IntelliJ Platform in Android Studio - so we can think about it as about hacked IDEA.
So usually backward compatibility exists - it means that I can open in a new version of IntelliJ IDEA my older projects, but not vice versa.
So if look at AS 4.0 release notes we can mention that it is based on IntelliJ IDEA 2019.3.3 (https://developer.android.com/studio/releases#4.0-idea-2019-3-3). But your try to open a project of newer version IntelliJ Platform (2020.2). So it fails because your try to open a newer project version (2020.2) by old IDEA (2019.3.3)
But you can without issues open a project of AS 4.0 with IDEA 2020.2 - it will simply convert older project layout to new.

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

Using SonarLint in eclipse

I am trying to learn how to use SonarLint plugin in Eclipse. I downloaded the plugin and I have 4 views in my Eclipse now - SonarLint on the Fly, SonarLint Report, SonarLint Rule Description, SonarQube Servers.
In the SonarLint on the Fly, I am able to see only the JavaScript bugs scanned by SonarQube. Not the Java ones (I have Java rule set in SonarQube server as well). But if I open a Java file, then I am able to view java bugs and errors in this window.
In SonarReport, I have two tabs at the bottom - Current Project and All Projects. When I click on Current Project it scanned the current project and showed me only JavaScript errors but not Java.
So, my question is - Is there any way to see Java errors along with JavaScript? I should be able to view the Java errors throughout my project (without having to open java files and then see the bugs).
If analysis of JavaScript files is working, it should be easy to also have Java files. Few things to check:
For Java analysis to work fine, you should have installed the optional feature "SonarLint For Eclipse Java Configuration Helper"
Java files that are not part of an Eclipse Java project are ignored
Also, in the SonarLint Report view, the two buttons will only analyze changed files (ie files that are reported as changed by your SCM) so be sure that you also have some Java files with modifications.
Looking at SonarLint console while enabling verbose + analysis logs may help to understand your issue.

Resources