I am trying to run a spring-boot Kotlin project.
When running mvn clean install I am getting this error:
A required class was missing while executing org.jetbrains.kotlin:kotlin-maven-plugin:1.4.10:compile: org/jetbrains/kotlin/cli/common/messages/MessageCollector
Good to mention that I do not have a folder named cli under .m2/repository/org/jetbrains/kotlin/
I tried to delete the repository folder and build again but that didn’t help.
I am using maven 3.6.3, JDK 11 and Kotlin compiler 1.4 which match with the config of the project.
If someone could help, it would be much appreciated.
The Kotlin compiler jar was broken for some reason. Downloading it from here and replacing it fixed the problem, in case somebody faces the same problem in the future! :)
Related
Setup:
Intellij IDEA community edition 2020.2
Spring Bott starter parent: 2.3.5
Java 11
WRAPPER_VERSION: 0.5.6
mvn 2
Hi,
I googled a lot e.g. here but I just can't fix it.
I created a new mvn spring project with Intellij. When I commit the project I get errors detected by code analyses in class: MavenWrapperDownloader.java.
e.g. It reports:
Cannot resolve symbol String
I tried:
invalidate caches and restart
delete .idea folder and reimport
checked sdk setup
mvn reimport
mvn clean and then rebuild (while the build is always successful)
I'm pretty new to maven. I guess the scope of the mvn package might be wrong because the build process works as expected.
UPDATE:
I reinstallt my openjdk11. No success. Then I found out that my .mvn/wrapper dir is not set as source root. I know that was never the case in my other projects. As a trial I've set my .mvn folder as source root and now the MavenWrapperDownloader.java file is recognized as a java class and the compiler interprets the symbols. But now there is another error. It says I have to define a package name for that class because the class does not have one per default. It is pretty strange to me. I also tried to use another spring boot starter version but nothing changed
When I execute Analyze->inspect code I get the following:
I had the same problem and File -> Invalidate Caches/Restart fixed it - at least for now.
IntelliJ Ultimate 2020.3
Spring Boot Starter Parent 2.4.2
Java 15
Maven 4.0.0
Maven Wrapper 0.5.6
The easiest solution is to generate your project again with Spring Starter.
After you set up everything you need at pom file -> Generate -> Download it.
Open with your IDE and copy-paste all code sources which you have already written.
I am trying to upgrade my project running in 1.5 to 1.8(jdk), and I am using Maven 3.0.4 in conjunction. While trying to execute command "mvn build" I get the error "The required class was missing while executing org.apache.axis2:axis2-wsdl2code-maven-plugin:1.3:wsdl2code: org/apache/neethi/policy".
I have tried installing fresh jars and pom files, added them to the build path, also added it to POM dependencies. I even added axis2-codegen jar as suggested in some answer in this site. I've even tried "mvn -U clean install", also as suggested in one the answers. But so far nothing seems to work. I am fairly new to Maven, so any help will be appreciated.
P.S.: I cannot post any actual code or snapshots of the errors as it is a corporate project. I have tried to put up as much data as possible without breaching my NDA.
Thanks.
Since you did not get a compile error, I am assuming there should be conflicting transient dependencies.
Try executing,
mvn dependency:tree -Dincludes=org.apache.axis2
If you have multiple versions of the same dependency, have the unintended versions excluded in your pom file.
Note: You can do this operation in your IDE too. "IntelliJ Idea", has a really nice interface for this operation.
When I run mvn deploy it seems like the generated source packages include target folder with its content. Really appreciate any clues on how to avoid this.
POM file:
https://github.com/apache/incubator-stratos/blob/master/pom.xml
Thanks
After doing some investigations I found the cause of the problem. The issue was with the maven assembly plugin version 2.2-beta-2. Upgraded it to 2.2.1 and the problem was solved. Thanks khmarbaise for your feedback!
Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.
Can someone let me know how to fix the same?.I tried to create a new maven project and it fails for some reason
Description Resource Path Location Type
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.5:resources failed: A required class was missing while executing org.apache.maven.plugins:maven-resources-plugin:2.5:resources: Lorg/sonatype/plexus/build/incremental/BuildContext;
Have updated the maven-resource-plugin to version 2.6. It works fine with M2Eclipse integration v1.3 milestone.
My experience with eclipse and maven is not good I have been working for a long time with both and they don't integrate properly. The best way to make them work together for me was to use command line to build, package and install the projects and eclipse to edit.
To import the projects into eclipse I just use mvn eclipse:eclipse and it will generate the files needed to import the project into eclipse.