mvn clean install works but intellij does not compile project - maven

I saw many people who faced that kind of problem before. I tried what they tried to solve the issue but still unfortunately no success.
I can run mvn clean install succesfully and nothing sees problem but unfortunately at Intellij(latest version), I can not compile the project. It says unable to compile the project. I invalidated caces, tried maven reimporting, deleted .iml and pom, checked settings javac compiler but everything seems find and still it does not compile. It is going to make me mad soon. Please help.

In IntelliJ settings you can check that you are using Javac (build,execution,deployment > compiler > java compiler) as a Java compiler and not AJC, Eclipse... or another compiler.

Related

My build fails everytime I make any small change in Intellij spring boot project

I need to do mvn clean install everytime to run the application. Otherwise, it shows build error, cannot find symbol errors.
How can I fix this?
I have tried removing intellij and installing again but doesn't seem to work.

Intellij reports dependency error when it actually has no errors

I am using a deeplearning4j dependency in my project, and this library does occur in the External Dependencies tree, but there is red flag in my code.
When I run the application in IntelliJ, it has no issue at all. mvn clean install doesn't generate any issue either. The only issue is the annoying red flag error. Please see the attachment. I tried all tests, but still can't get rid of the message. Please help!
I had the same issue.
I closed the project and imported it from the pom file.
That worked for me!

Classpath entry points to a non-existent location warning when compiling with Maven

We recently upgraded from Kotlin 1.1.51 to 1.2.10, cleared all the warnings (we use -Werror to treat warnings as errors), and the project is up and running. We build it from command line using mvn verify without issues, as well as from IntelliJ using Build > Build project.
Then, we decided to upgrade to the latest version (1.2.21), and here is where we are seeing some issues: when compiling the project from command line (mvn verify) a warning shows up causing the compilation to fail:
[WARNING] Classpath entry points to a non-existent location: /Users/username/git/projectname/target/classes
The interesting thing is that if we do Build > Build Project on IntelliJ, then there is no warning, and the project will compile (and run) without issues. And if we downgrade Kotlin's version to 1.2.10 on the pom file (instead of 1.2.21), it builds successfully again from both command line and IntelliJ Build.
We noticed that when we do Build > Build Project, two directories are created in the target folder: classes and test-classes; while when the command line build fails, there are two different directories: kotlin-ic and maven-status.
I saw questions that seem related (1, 2, or 3), but their errors/warnings seem specific to certain libraries while in this case it looks like something more general (it's not a particular library that I can add as a dependency as suggested on the answers).
Why is that difference between command line and IntelliJ build? What causes that warning, and how can we fix it?
I had similar problem and I got it working by disabling kotlin incremental compiler :).
<kotlin.compiler.incremental>false</kotlin.compiler.incremental>
For future readers: if you have the inverse problem (building from the command line works, but building in IntelliJ fails):
in IntelliJ, go to Project settings -> Libraries
remove all entries
rebuild the project

IntelliJ Mac - LESS Compiling with Autoprefixer

I was using a file watcher in IntelliJ which automatically compiled my less files into css files. I added an argument to the file watcher which used the autoprefix plugin to add all the prefixes to the compiled css file.
I now switched from a windows machine to mac and I can't get it to work like this there. I installed the autoprefix plugin via npm: https://github.com/less/less-plugin-autoprefix
And I set everything like it was on my windows machine: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000659610-Autoprefixer-in-file-watcher
But now I only get the error message:
"Unable to load plugin autoprefix please make sure that it is
installed under or at the same level as less"
Same error occurs when calling the compiling with plugin from the command line. LESS compiling itself is working fine.
Does anyone has an idea what I'm missing? I'm pretty new on Mac so I don't know if I miss some environment variables or something? Or how can I check where the plugin is installed and where do I have to install it?
Thanks to an answer which seems to has been deleted in the meantime I found the solution.
The current autoprefix plugin needs an older version of less. It's not compatible with less 3.0.1.
After uninstalling less and installing version 2.7.3 with
npm install -g less#2.7.3
it is working again.
Found the solution here: https://github.com/less/less-plugin-autoprefix/issues/30

Can't get plugins to install on my Hudson CI server

I'm trying to stand up a Hudson CI server.
I'm following an article written here.
I've gotten the server to stand up successfully by itself, but when I go to install the plugins all the plugins fail to install.
This happens the second time I run
java -DHUDSON_HOME=data -jar hudson.war
when I have all my plugins in the /plugins folder.
The errors I'm getting are
No 'Plugin-Class' entry in the manifest of ...msbuild.hpi
No 'Plugin-Class' entry in the manifest of ...nunit.hpi
Dependency analysis-core doens't exist (related to task.hpi)
I grabbed the latest stable release of them, so I'm thinking it has something to do with how I set up my hudson instance. The only different thing that I have done from the article is that I set up the installation in C:\Hudson.
Does anyone know why these plugins are all failing?
The problem was that for some reason I downloaded version 1.1 of hudson. I'm not sure how that happened since I clicked on the latest link, but I went back and downloaded the real latest version and the plugins are installing fine now.
The tasks plugin still doesn't install, but I don't really have to have that one, I was just curious what it was.

Resources