I added the dependencies suggested on the mapstruct installation guide but the dependencies are not downloaded and therefore compiler cannot find the annotations.
Here are my dependencies:
Intellij's view for external libraries:
the dependency should appear above the mockito dependency
There are no errors, the project runs perfectly as it is, but I can't use mapstruct.
I have the mapstruct plugin installed
What have I tried so far:
changing mapstruct version
deleting caches
gradle --refresh-dependencies
gradle clean build
and a lot of researching but I couldn't find anything.
I feel like I'm missing something really obvious here, but I can't tell what it is.
Gradle version: 6.6.1
Related
I need to update Gradle version in kotlin project. Have I any option to check if all dependencies support new version of Gradle or I need to check all dependencies release nots to make sure.
Actually for me it's not pretty clear how dependencies can't support new version of Gradle.
For instance:
Have I any option to check if all dependencies support new version of Gradle
There two sets of dependencies:
Application dependencies -- https://docs.gradle.org/current/userguide/declaring_dependencies.html
Applications dependencies have no correlation with Gradle whatsoever. These are dependencies needed to build your application and has no impact on Gradle's build environment.
Build dependencies
https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
https://docs.gradle.org/current/userguide/plugins.html
These dependencies, commonly Gradle plugins, do have an impact of your build. Whether or not a plugin supports a version of Gradle is only known by going to the source and checking release notes, if any. If it is not clear if a plugin supports a particular version of Gradle, then your only option is to upgrade your version of Gradle and see if anything breaks.
So I was getting the error in this post. I tried upgrading gradle and got another error relating to using an unsupported version of gradle, so I went back to the 4.4.2 version.
Now, I know this is a duplicate of the other question but the problem still exists and has not been solved for the newer versions of gradle and idea. Also I do not want to use a wrapper.
Error I receive:
Unable to load class 'org.slf4j.LoggerFactory'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)</li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)</li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Gradle version: 4.4.2
IntelliJ IDEA version: 2018.3.5
You can find a test project here to reproduce the issue. Keep in mind the above versions.
Using the official gradle install method with SDKMAN!, the problem goes away.
The linux gradle package must be dodgy and hence IDEA is complaining.
I am having an issue with log4j-api. I have specified log4j-api:2.8.1 in my pom but when running a mvn clean install command, mvn keeps insisting that I need log4j-api:2.1. If i delete the log4j-api:2.1 directory from my .m2/repository and do the mvn clean install command, it will say it is downloading the 2.1 version.
Here's the weird thing: If I do a mvn dependency:tree there is no mention of version 2.1, only 2.8.1.
Anybody understand why mvn dependency:tree would say my project is NOT dependent on version 2.1 but then downloads the 2.1 version when I run mvn clean install?
Some other versions we are using in case somebody knows that something could be causing this:
Spring Boot 1.2.1
Spring Framework 4.1.6
Elastic Java APIs 5.6.4
Get the dependency tree in verbose mode
mvn dependency:tree -Dverbose
From maven docs
More specifically, in verbose mode the dependency tree shows dependencies that were omitted for: being a duplicate of another; conflicting with another's version and/or scope; and introducing a cycle into the dependency tree.
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.
I have two maven projects in Netbeans. How can I add one as dependency for another?
In Intellij IDEA I can just add <dependency> and it works fine. But Netbeans can't resolve this dependency this way.
You should be able to do so, in Netbeans. Just make sure to have the project, you want to use as dependency, is built into your maven-local-repo by executing a maven-install.
I don't know how it works in Netbeans, but in Eclipse you can just Rightclick -> Run as-> Maven Install to install your project.
Maybe in Netbeans, you have to use the Maven-cmd-tool. Just navigate to the location in your project, where your pom.xml is, and run mvn install. That should install your project into your maven-local-repo. After that, just run mvn clean install -U in your other project, which uses the previously built project as dependency, and it should recognize the dependency.