So whatever I do I can't get my project to run on my mac. But the project seems to run fine on my colleagues pc's. Is there something i'm not seeing in my pom file? I keep getting this error,
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(default-cli) on project got-team20: Command execution failed. Process
exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e
switch. Re-run Maven using the -X switch to enable full debug logging.
I have maven 3.5.0 installed on my mac, but i don't know if that can be a issue? I have also tried three different ide's, so the problem is not there.
My pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.gameoftrades</groupId>
<!-- Change Me -->
<artifactId>got-team20</artifactId> <!-- got-teamNN -->
<!-- -->
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Game of Trades Student Starter Kit</name>
<description>Student starter kit for Game of Trades</description>
<inceptionYear>2016</inceptionYear>
<licenses>
<license>
<name>Apache License 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>42 BV</name>
<url>http://blog.42.nl/</url>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<got.version>0.3.0</got.version>
<junit.version>4.11</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gameoftrades</groupId>
<artifactId>gameoftrades-library</artifactId>
<version>${got.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
This is the full error i have when i run it with the -e switch.
[ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on
project got-team20: The parameters 'mainClass' for goal
org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or invalid
-> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java
(default-cli) on project got-team23: The parameters 'mainClass' for
goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or
invalid...
So i guess something is wrong with the plugins i am using.
Related
Please guide me how to proceed further while doing the mvn release:prepare in my spring boot project also do tell how to add ssh key to my project if it is required.
I tried many solutions but none work as it is showing the same error everytime and this is my modular approach based project and IDE I am using is IntelliJ.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release- plugin:2.5.3:prepare (default-cli) on project vj-pet-clinic: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] git#github.com: Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
my pom.xml file is :-
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>pet-clinic-data</module>
<module>pet-clinic-web</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.vinamra</groupId>
<artifactId>vj-pet-clinic</artifactId>
<version>0.0.1</version>
<name>vj-pet-clinic</name>
<description>VJ pet clinic project</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<goals>install</goals>
<checkModificationExcludes>
<checkModificationExclude>pom.xml</checkModificationExclude>
</checkModificationExcludes>
</configuration>
</plugin>
</plugins>
</build>
<scm>
<developerConnection>scm:git:git#github.com:username/repository.git</developerConnection>
<tag>vj-pet-clinic-0.0.1</tag>
Please help me how to push the release the plugin using maven.
You can use HTTPS instead of SSH to avoid the keys exchange. Here is an example:
<scm>
<url>https://github.com/(username)/(repo)</url>
<connection>scm:git:https://github.com/(username)/(repo).git</connection>
</scm>
Replace (username) and (repo) accordingly.
I was trying to deploy a maven project to Google App Engine, but whenever i use the command mvn appengine:deploy in cmd i get this error
[INFO] GCLOUD:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:43 min
[INFO] Finished at: 2017-04-21T21:43:13+07:00
[INFO] Final Memory: 22M/287M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:appengine-maven-
plugin:1.2.1:deploy (default-cli) on project cc_w10: Execution default-cli
of goal com.google.cloud.tools:appengine-maven-plugin:1.2.1:deploy failed:
Non zero exit: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Here's my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.cc_w10.sample</groupId>
<artifactId>cc_w10</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<INSTANCE_CONNECTION_NAME></INSTANCE_CONNECTION_NAME>
<user>user1</user>
<password>1234</password>
<database>sqldemo</database>
<sqlURL>jdbc:mysql://google/sqldemo?cloudSqlInstance=cc-week-five:us-central1:root&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=root&password=1234&useSSL=false</sqlURL>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud.sql</groupId>
<artifactId>mysql-socket-factory-connector-j-6</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
</dependencies>
<build>
<finalName>cc_w10</finalName>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
<plugin>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>1.9.50</version>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.7.v20160115</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Does anyone know how to solve this problem? I've been looking for the solution for days but it seems hopeless.
your project is a spring boot project so try using spring-maven plugin to generate the jar
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
I had the same problem, and tried it a different way.
Since appengine:deploy didn't seem to copy my app.yaml but instead created its own, I tried to use gcloud commands directly on the target/appengine-staging after pasting my yaml file.
Then I run gcloud app deploy and it worked thanks to this line I added in app.yaml:
health_check: enable_health_check: False
Starting from version 1.3.0 the appengine plugin even doesn't detect my app.yaml in the first place. However it's set on the root folder. I suppose it requires it in a different place/folder but I don't know which one.
Pretty late to the party, but make sure you have specified the packaging as 'war'. That solved my issue.
I am using Maven for the first time (in Eclipse). I would like to include
HakariCP to my project. Every time I try to build my project I get following error message:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project WindowPanel: Fatal error compiling: invalid target release: 1.8 -> [Help 1]
Here is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.gustavwww</groupId>
<artifactId>WindowPanel</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>WindowPanel</name>
<description>A Windows Server Panel</description>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.10.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
Thanks in advance!
EDIT: All I did was update my JDK to the latest version.
If you have JRE set to 1.7 by default in Eclipse you need to specify 1.8 in the Run Configurations. Go to "Run > Run Configurations..." and select the Maven Build you have problem with. Then click the JRE tab and choose Execution Environment Java 1.8.
If you really need to compile it against Java 8, read this question and answer.
They provide more than one to way to force Maven to use a specific version of Java.
When I run the maven project in Jenkins, I am getting the following error. I am new to this maven project, any help will be appreciated. Thank you
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.614s
[INFO] Finished at: Tue Sep 08 11:56:39 IST 2015
[INFO] Final Memory: 16M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:generate-sources (default-generate-sources) on project PowerMeter: MojoExecutionException: ANDROID-040-001: Could not execute: Command = cmd.exe /X /C "D:\android-sdks\build-tools\23.0.0_rc3\aapt.exe package -f --no-crunch -I D:\android-sdks\platforms\android-22\android.jar -M E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\AndroidManifest.xml -S E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\res -A E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target\generated-sources\combined-assets\assets -m -J E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target\generated-sources\r --output-text-symbols E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\target --auto-add-overlay", Result = 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[JENKINS] Archiving E:\Jenkin\.jenkins\jobs\powermeter\workspace\PowerMeter\pom.xml to com.maetree.powermeter/PowerMeter/2.0.0/PowerMeter-2.0.0.pom
channel stopped
I have my pom.xml content below
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.maetree.powermeter</groupId>
<artifactId>PowerMeter</artifactId>
<packaging>apk</packaging>
<version>2.0.0</version>
<name>app_name</name>
<url>http://maven.apache.org</url>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<app.version.code>2</app.version.code>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version>5.1.1</platform.version>
<android.plugin.version>3.8.2</android.plugin.version>
<projectVersion>2.0.0</projectVersion>
<packagingType>apk</packagingType>
<android.maven.version>3.8.2</android.maven.version>
<abs.version>4.3.1</abs.version>
<dagger.version>1.0.1</dagger.version>
<otto.version>1.3.4</otto.version>
<gson.version>2.2.4</gson.version>
<menudrawer.version>3.0.2</menudrawer.version>
<android.sdk.path>D:\android-sdks</android.sdk.path>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.2</version>
<extensions>true</extensions>
<configuration>
<sdk>
<platform>22</platform>
<path>D:\android-sdks</path>
</sdk>
<emulator>
<avd>demodevice</avd>
<wait>100000</wait>
<options>-no-skin</options>
</emulator>
<zipalign>
<verbose>true</verbose>
</zipalign>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.0.1.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
This is the first time i am using maven project
Its says it can't execute D:\android-sdks\build-tools\23.0.0_rc3\aapt.exe. Have you tried running that full command from the command line?
DId you try running maven locally?
This is not a jenkins problem. This is your maven build failing
I am having a Maven project that has following file structure :
src/main/java/com/TestFolder/{Java file name}
This Java file contains a main method that I need to execute with argument from command line. How this can be done ? Please help.
Currently am doing something like this :
mvn exec:java -Dexec.mainClass=src.main.java.com.TestFolder.MyMainJavaClass -Dexec.args="1"
Is this right syntax to do it ? Because when i run this i get following error :
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven- plugin:1.4.0:java (default-cli) on project Staples_7Lakh: Execution default-cli of goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java failed: Plugin org.codehaus.mojo:exec-maven-plugin:1.4.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: backport-util-concurrent:backport-util-concurrent:jar:3.1, org.apache.maven:maven-core:jar:2.2.1, org.codehaus.plexus:plexus-utils:jar:3.0.20: Could not transfer artifact backport-util-concurrent:backport-util-concurrent:jar:3.1 from/to central (https://repo.maven.apache.org/maven2): GET request of: backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar from central failed: SSL peer shut down incorrectly -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
This problem is because the dependancies are missing in the executable jar. The executable jar needs all run time dependencies to be present. I also had a similar problem which I solved using maven assembly plugin please find below configuration with the pom file for the assembly plugin configuration -
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>xyz.jeetendra.hibernate.Sample</groupId>
<artifactId>Excercise1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Excercise1</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
</dependencies>
<build>
<finalName>UserService</finalName>
<plugins>
<!-- maven Assenmbly Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<!--get all project dependency -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- Main class in mainfest make a executable jar -->
<archive>
<manifest>
<mainClass>xyz.jeetendra.hibernate.sample.Service</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
BR