How to maven release:prepare issue and Plugin not found issue - java

Hello I am following along a Spring course and am currently trying to do multi-module maven builds. Most of it is working however it is sating my maven-release-plugin cannot be found. As well as this when i run release:prepare I am getting this error:
Maven Error
I am completely lost on ways to solve it, I have tried to delete and reimport the plugins. invalidate the cache and restart yet I cannot solve it. Any help would be great.
If you need any more code please let me know

You can only run the Maven release plugin if you commit your changes first.

Related

MAVEN ERROR : "Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.2.0:clean "

Need your kind help here. I am trying a very simple springweb application from Eclipse, but When I try Run As->Maven clean, I am getting below error.
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.2.0:clean ---requires MAVEN 3.2.5.
MY Maven Version is: 3.8.6, however I have read in the maven-clean-plugin:3.2.0: documentation that, it supports Maven:3.2.5+
You may indirectly addressing a maven-clean-plugin different than 3.2.0.
Please inspect your dependencies tree by mvn dependency:tree and find out if this is your real issue.

Maven site fails while building javadoc

I try to build a site for my minecraft plugin but it fails during javadoc generation. I have my pom.xml and the log in this gist.
When I run mvn clean site it fails while generating javadoc because it does not find the dependencies used in my program. The problem is, that these dependencies are usually provided by the server, which tries to run the plugin so it does not make any sense to compile these dependencies. For some dependencies it is even forbidden to compile them. For example the spigot-api, which is part of the io.papermc.paper:paper-api-dependency.
And the weird thing is, it works just fine in IntelliJ. When I run the mvn clean site-command in IntelliJ using a run configuration it works just fine.
I already tried the additionalDependencies option but it did not improve the result.
I could stop it from failing the build by setting failOnError and failOnWarning to false but I still don't want these errors in my log.
Any ideas how to fix it?
Sincerely yours,
Trqhxrd

Maven tomcat7:run for multi-module project in IntelliJ

We have a multi-module Maven project: project-war depends on project-api.
I have imported the modules into IntelliJ, and I would like to use tomcat7:run to run run the project-war application in Tomcat. I do so, the application runs fine.
I make a change to project-api, stop Tomcat, restart Tomcat. The project-war application runs again fine, but the changes to project-api are not reflected as expected.
How to get the transitive changes from my workspace to be reflected when running tomcat7:run?
I've tried "Resolve Workspace artifacts". It didn't help. In fact, I don't get this setting at all.
I've tried "Before launch:" "Make". It does what appears to be a build (compile) but it didn't help either.
I think what I"m looking for is pretty much what m2e/Eclipse calls workspace resolution. Can't get it to work in IntelliJ. Your help much appreciated!
This is a good repository to test this out.
As it turns out, this problem existed using IntelliJ 12.1.7, but not anymore using IntelliJ 13.1.5.
Workspace resolution works with a combination of the described configuration:
Resolve Workspace Artifacts
Before launch: Make

Java exception: java.lang.UnsupportedOperationException

I'm trying to execute Maven -> Update project in Eclipse. Every time i do it i get the following error:
An internal error occurred during: "Updating Maven Project".
"java.lang.UnsupportedOperationException".
If i look in the code there aren't any files marked with errors, neither the pom.xml.
Other people working on the same project don't have this problem.
What could be causing this? What details do you need to get an idea about this?
it looks you have problem with one of artifacts you have in local repository try to delete .m2 and clean install project again but you have to be connected to internet, if this not solving your issue check the version of maven you are using and compare it with others.

Eclipse throws NullPointerException during Maven update

I've been fighting an internal Eclipse error for two days. I'm running the latest Spring Tool Suite edition of Eclipse, and I've attempting to import a collection of existing Maven projects. Whenever I do so, Eclipse throws a NullPointerException, but no stack trace is available from the Error Log view. If I instruct Eclipse to update the Maven project (Maven > Update Project), I get a NullPointerException again. This time, the Error Log view reports the following stack trace:
java.lang.NullPointerException
at org.eclipse.wst.common.componentcore.internal.resources.VirtualResource.getProjectRelativePaths(VirtualResource.java:119)
at org.eclipse.wst.common.componentcore.internal.resources.VirtualFile.getUnderlyingFiles(VirtualFile.java:104)
at org.eclipse.wst.common.componentcore.internal.resources.VirtualFile.getUnderlyingResources(VirtualFile.java:93)
at org.eclipse.wst.common.componentcore.internal.resources.VirtualResource.exists(VirtualResource.java:88)
at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getNonBinaryComponentManifest(ManifestUtilities.java:124)
at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getManifest(ManifestUtilities.java:81)
at org.eclipse.jst.common.internal.modulecore.util.ManifestUtilities.getManifestClasspath(ManifestUtilities.java:147)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getManifestClasspath(J2EEModuleVirtualComponent.java:248)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.calculateManifestReferences(J2EEModuleVirtualComponent.java:368)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.cacheManifestReferences(J2EEModuleVirtualComponent.java:360)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:176)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:214)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:207)
at org.eclipse.m2e.wtp.WebProjectConfiguratorDelegate.configureClasspath(WebProjectConfiguratorDelegate.java:386)
at org.eclipse.m2e.wtp.WTPProjectConfigurator.configureClasspath(WTPProjectConfigurator.java:107)
at org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate.populateClasspath(DefaultClasspathManagerDelegate.java:61)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:253)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:363)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:343)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:371)
at org.eclipse.m2e.jdt.internal.BuildPathManager.updateClasspath(BuildPathManager.java:191)
at org.eclipse.m2e.jdt.internal.BuildPathManager.mavenProjectChanged(BuildPathManager.java:180)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:746)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:865)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:289)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:369)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:316)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:1)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:161)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:137)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:89)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1301)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:313)
at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:77)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Here's what I've tried:
I've blown away my workspace and created a new one. Multiple times.
I've blown away my Maven repository so that it would be re-created.
I've reinstalled Spring Tool Suite.
I've tried asking Eclipse to update the Maven repositories.
I've checked for merge conflicts in my local SVN repository. (There are none; this is a brand new branch from trunk that is freshly checked out.)
I've checked the Synchronize view in Eclipse to see if it notes any differences. (Eclipse can't get far enough to recognize any projects available to synchronize.)
I've searched Google for NullPointerExceptions occurring in VirtualResource.getProjectRelativePaths(). I've found NullPointerExceptions in other very similar places, and I've tried the recommendations for them, just for the heck of it, but none of them work.
I'm at my wits' end with this problem. Help me, Obi-Wan Kenobi, you are my only hope.
This is what I did to fix it:
Removed the project from the workspace
Remove .classpath, .project and .settings folder
Reimport the project
I'm strongly sure that the problem is not related to the maven plugin; but if it is, i was wandering if you run a mvn eclipse:eclipse before importing the project into eclipse, if you do that and you are using maven 3, I had checked that maven plugin does not support maven 3 properly yet; so I encourage you to make a mvn eclipse:clean, then import the project as an existing project, and after that activate the maven plugin nature from eclipse.
I hope it helps,
PS. it seems to be a know eclipse bug (https://www.google.com.uy/search?q=j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java&oq=j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java&aqs=chrome..69i57.128j0j7&sourceid=chrome&espv=210&es_sm=91&ie=UTF-8); try downloading the last eclipse version; I'm using kepler at work, and I'm working in maven/spring projects and it works fine.
Good luck!
This happens because your m2e plugins are corrupted. To rectify follow the steps below.
close eclipse
Go to your eclipse workspace folder Under .metadata/pluigns folder, identify all m2e plugins
delete them
copy the relevant plugins from non-corrupted workspace, either from
your machine or from any one of your team members machine
restart eclipse
As echinelli indicated, this did turn out to be an Eclipse (or STS) bug, but installing the latest version isn't the fix, as I already had that version installed. I had installed STS based on Eclipse 4.x; when I uninstalled that and went to the 3.x version, the problem went away.
Ok, I had the same issue with a more obscure reason.
I used pluginExecution for aspectj-maven-plugin and over the course of trying to fix yet another maven issue I had commented out <action><execute><execute></action>
This leads to the nullpointerexception.
I solved by adding the <build> section with "maven-compiler-plugin" artifact in the POM. I noticed that without it, Eclipse threw a java.lang.NullPointerException.

Categories

Resources