Failed to execute goal maven release:prepare - maven

I'm having problems when I run mvn release:prepare. I have the following message:
[ERROR] Failed to execute goal org.apache.maven.plugins: maven-release-plugin: 2.5.1: prepare (default-cli) on project marketplace-po
c: Failed to invoke Maven build. Error configuring command-line. Reason: Maven executable not found at: C: \ dev \ apache-maven-3.3.1 \
bin \ mvn.bat -> [Help 1]

As of version 3.3.X, Maven renamed mvn.bat to mvn.cmd. This is fixed in the maven-release-plugin version 2.5.2: MRELEASE-902
They suggest adding the following section in case the fixed plugin version is not picked up automatically:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

I just had same problem when running from eclipse, it resolved by making
copy of mvn.cmd to mvn.bat
And it worked for me.

I had the same problem too at using Maven 3.3.1 in Windows 8.1. I searched on it and found that mvn.bat moved to mvn.cmd. Still, I don't know how to solve it at the version. So, I downloaded Maven 3.2.5 and there was the mvn.bat file. And it worked for me.

Fixed, i had same problem with maven 3.5.0 instalation, so just copy mvn.cmd and rename it to mvn.bat at C:\Program Files\apache-maven-3.5.0\bin.

Related

Failed to execute goal Spring Framework Maven

I have a project_1 which is using JAR of project_2.
project_2 is using the spring framework.
project_2 builds successfully but project_1 fails with below error using 'mvn clean install' command:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage on project : xxx
: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.5.4:repackage failed:
Plugin org.springframework.boot:spring:boot-maven-plugin:2.5.4 or one of its dependencies could not be resolved.
Failed to read artifact descriptor for org.springframework.boot:spring-boot-buildpack-platform:jar2.5.4 Could not transfer artifact org.springframework.boot:spring-boot-buildpack-platform:pom:2.5.4 from artifact repository: Failed to transfer file http://repo.xxx.com/repo/org/springframework/boot/spring-boot-builpack-platform-2.5.4 with status code 308
I tried below command on project_1
" mvn clean install -U"
but it does not help.
One more thing I noticed:
Project_1 has following lines
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
and If I comment above plugin everything works perfectly.
But do not know if commenting it is a good idea or not.

Athena latest JDBC driver jar AthenaJDBC42_2.0.14

https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html
I've installed latest jdbc jar into my local mvn repo. While i'm trying to build my project I'm getting below error.
Failed to collect dependencies at Athena:AthenaJDBC42:jar:2.0.14.1000: Failed to read artifact descriptor for Athena:AthenaJDBC42:jar:2.0.14.1000: 1 problem was encountered while building the effective model for Athena:AthenaJDBC${env.JDBC_V}:${env.MAJOR_V}.${env.MINOR_V}.${env.REVISION_V}.${env.BUILD_V}
[ERROR] [ERROR] 'artifactId' with value 'AthenaJDBC${env.JDBC_V}' does not match a valid id pattern. #
Anyone have any idea, how to resolve this error.?
It is difficult to say with just the small Maven error snippet, but it looks like Maven doesn't recognize the property ${env.JDBC_V} or it contains some invalid value like a space.
I recommend to generate a Maven effective pom model (mvn help~effective-pom) and execute Maven in debug mode (mvn -X ...) to try to troubleshoot the cause.
I was facing the same error. It got resolved when I installed jar into repository using following command. (Ensure you deleted all existing instances of athena drivers jar files from .m2 before executing command)
mvn install:install-file -Dfile=/Users/chetanparekh/Downloads/AthenaJDBC42_2.0.14.jar -DgroupId=Athena -DartifactId=AthenaJDBC42 -Dversion=2.0.14.1000 -Dpackaging=jar
Snippet from my POM.
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>
<sharedLibrary>
<groupId>Athena</groupId>
<artifactId>AthenaJDBC42</artifactId>
</sharedLibrary>
</sharedLibraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>Athena</groupId>
<artifactId>AthenaJDBC42</artifactId>
<version>2.0.14.1000</version>
</dependency>
</dependencies>
Thank you for your answer.
I finally resolved it using
mvn install:install-file -Dfile=/Users/dk/Downloads/AthenaJDBC42_2.0.14.jar -DgroupId=Athena -DartifactId=AthenaJDBC42 -Dversion=2.0.14
Removed the build version(1000) and -Dpackaing=jar, it worked. I'm not sure what could be the problem with build version .1000 and -Dpacking=jar.
Thanks Again.!

Failed to execute goal org.apache.maven.plugins - package does not exist

I'm trying to use mvn install, but I keep getting this error
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project example-module-core: Compilation failure: Compilation failure:
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[10,47] package org.springframework.web.context.support does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[9,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/DatabaseServiceImpl.java:[22,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[11,50] package org.springframework.transaction.annotation does not exist
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/module/service/impl/InitializerServiceImpl.java:[28,2] cannot find symbol
[ERROR] symbol: class Transactional
[ERROR] /C:/terasoluna-plus/example-module-core/src/main/java/com/mycompany/project/example-module-core/src/main/java/com/mycompany/project/module/util/InitServlet.java:[25,11] cannot find symbol
[ERROR] symbol: variable SpringBeanAutowiringSupport
[ERROR] location: class com.mycompany.SIAR.module.util.InitServlet
[ERROR] -> [Help 1]
In my InitServlet.java I have all the imports, and it has no errors. In the pom.xml I have all dependencies needed, but this problem always persists.
All the other solutions tell me to add the dependency and use Maven Update, but it is definitely not missing code/dependencies, because this project is being shared with 2 other users, and it works fine on the other machines. It is the exact same project.
I had this working for a few hours, after countless tries of mvn clean install, one of them got the BUILD SUCCESS and I didn't change anything, and it was working fine. But later, after changing some java files, I used mvn clean install, and got again the same error.
Any ideias of what it might be?
Thanks in advance.
I fixed it. Apparently it really needed 2 more dependencies on a pom.xml that was on another folder. I needed to add to a pom.xml that was in a core folder, these 2 dependencies.
<dependency>
<groupId>org.terasoluna.plus.framework</groupId>
<artifactId>terasoluna-plus-web-conf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
After adding it, I ran mvn clean install, and it installed successfully. Thank you anyway for all your help.
At time when it is working on other systems with exact pom , and not working on mine, I look into differences....
In my local repository - Delete the problematic dependency and run mvn clean install. Whatever dependencies are needed will be downloaded again by maven.
In my maven settings.xml - at the location ${MAVEN_HOME}/conf.What is the difference , did I over-ride any settings?
Difference in JDK version or Maven version.
I hope this helps.
you need to add maven-compiler-plugin into pom.xml. you can find the plugin code below and replace the source version by your jdk version:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source> // jdk version
<target>1.8</target> // jdk version
</configuration>
</plugin>

Sonar Maven not working (org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli)

I see I am not the only one having this problem from 14 hours ago.
At my office, other projects are failing too but the message shown make reference to sonar-maven-plugin:2.6:sonar
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project x: Unable to determine structure of project.
Any ideas?
Define in your parent pom.xml the previous version of the plugin, it seems the latest version 2.7 has an issue you can pin the version like this :
<pluginManagement>
<plugins>
:
:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
This has been fixed in 2.7.1. You can check this JIRA issue.
I just got hit with this issue. There's some issue with the 2.7 plugin so I tried forcing Maven to use the 2.6 plugin via the command line as below. Or you can add to pom.xml
-> mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
It seems downgrading the plugin from 2.7 to 2.6 at jenkins/configure in the server solves the issue.
Thanks to all!

Sonar 4.1.1 maven plugin can't be resolved

I'm using SonarQube 4.1.1 and have the following configuration in my pom.xml file:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.1.1</version>
</plugin>
</plugins>
</pluginManagement>
When I try to run sonar from the command line using the maven plugin I get:
[ERROR] Plugin org.codehaus.mojo:sonar-maven-plugin:4.1.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:sonar-maven-plugin:jar:4.1.1: Failure to find org.codehaus.mojo:sonar-maven-plugin:pom:4.1.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
Anyone know how to fix this issue? Do I need to make some configuration changes?
In fact this configuration is not needed. Have you try to run an analysis without it? You should give a try if you haven't.
But if you really need to force the version of the sonar-maven-plugin, you should set it to 2.1 on Maven 3.
See http://docs.codehaus.org/display/SONAR/Analyzing+with+Maven for more details.
Regards
Try this:
mvn clean sonar:sonar -U
The -U flag means force update of dependencies.

Resources