Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project playerinputs: Exit code: 1 -> [Help 1] - maven

I was trying to upload my first api to the maven central but I continue getting this error. I haven't been able to solve it. I am running mvn clean deploy
I have read that running mvn clean deploy -Dgpg.skip=true could work but it doesn't. I also have read this threads: stackoverflow github but it doesn't work
Here is the error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.411 s
[INFO] Finished at: 2020-06-07T14:15:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project playerinputs: Exit code: 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
I have checked the page that is linked in the error but I coudn't love it
Here is my pom
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.MrNemo64</groupId>
<artifactId>playerinputs</artifactId>
<version>1.2</version>
<name>PlayerInputs</name>
<description>Useful clases to get player inputs in several ways</description>
<url>https://github.com/MrNemo64/player-inputs</url>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<developers>
<developer>
<name>Javier Rodríguez Pérez</name>
<email>my.nemo_64.otravez#gmail.com</email>
<organization>org.github.MrNemo64</organization>
<organizationUrl>https://github.com/MrNemo64/player-inputs</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/MrNemo64/player-inputs.git</connection>
<developerConnection>scm:git:ssh://github.com:MrNemo64/player-inputs.git</developerConnection>
<url>https://github.com/MrNemo64/player-inputs</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Bukkit API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
</project>
Tell me if you need more information and thanks for the help!

In some cases if you are using gpg plugin to sign your artifacts you might get the following error and the build will fail.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project testng-parser: Exit code: 2
If you get the above error there are few ways to skip artifact signing and carryout your build.
Method 1 : Editing your POM
You can disable the gbp plugin from the POM or skip the signing of artifacts. Refer the following.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
Method 2 : Disabling at runtime
You can also disable gpg signing at runtime by running the mvn build with following parameter.
mvn clean install -Dgpg.skip
Or as
mvn clean install -Dgpg.skip=true

Related

Maven-tycho says Lombok required artifact is missing although other dependencies work

I created a p2 repo to add plugins that I later use as tycho dependencies. I however stumble across the error stack below for the lombok dependency. I know lombok is a bit of a special dependency. So I downloaded it and added it to my plugins folder and installed it. I get a different error than when I simply don't have the lombok.jar folder in the plugins folder but the suggestions listed in the error stack did not fix the issue. I also tried solutions discussed in this other stackoverflow post
mvn package fails with Required Artifact Missing even though it exists in my Remote Repository
but I still have the same mistake. My groovy dependency was added without problems.
``` mvn eclipse:eclipse
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.project:com.project.bbcode.parser:1.0.0-SNAPSHOT # C:\Users\Khady\temp\bbcode-lite-parser\pom.xml
[WARNING] Missing POM for org.projectlombok:com.project.lombok:jar:1.16.8
[ERROR] Internal error: java.lang.RuntimeException: Could not resolve project dependencies: Missing:
[ERROR] ----------
[ERROR] 1) org.projectlombok:com.project.lombok:jar:1.16.8
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.projectlombok -DartifactId=com.project.lombok -Dversion=1.16.8 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.projectlombok -DartifactId=com.project.lombok -Dversion=1.16.8 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) com.project:com.project.bbcode.parser:pom:1.0.0-SNAPSHOT
[ERROR] 2) org.projectlombok:com.project.lombok:jar:1.16.8
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] com.project:com.project.bbcode.parser:pom:1.0.0-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] project-plugins (file:C:/Users/Khady/temp/repository, releases=false, snapshots=false),
[ERROR] eclipse-luna (http://download.eclipse.org/releases/luna, releases=false, snapshots=false),
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false),
[ERROR] projectlombok.org (http://projectlombok.org/mavenrepo, releases=true, snapshots=true)
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Could not resolve project dependencies
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Could not resolve project dependencies
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:276)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:204)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
... 11 more
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) org.projectlombok:com.project.lombok:jar:1.16.8
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.projectlombok - DartifactId=com.project.lombok -Dversion=1.16.8 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=org.projectlombok -DartifactId=com.project.lombok -Dversion=1.16.8 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) com.project:com.project.bbcode.parser:pom:1.0.0-SNAPSHOT
2) org.projectlombok:com.project.lombok:jar:1.16.8
----------
1 required artifact is missing.
for artifact:
com.project:com.project.bbcode.parser:pom:1.0.0-SNAPSHOT
from the specified remote repositories:
project-plugins (file:C:/Users/Khady/temp/repository, releases=false, snapshots=false),
eclipse-luna (http://download.eclipse.org/releases/luna, releases=false, snapshots=false),
central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false),
projectlombok.org (http://projectlombok.org/mavenrepo, releases=true, snapshots=true)
at org.apache.maven.artifact.resolver.DefaultResolutionErrorHandler.throwErrors(DefaultResolutionErrorHandler.java:71)
at org.apache.maven.DefaultProjectDependenciesResolver.resolveImpl(DefaultProjectDependenciesResolver.java:164)
at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:76)
at org.apache.maven.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:60)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.collectPomDependencies(P2DependencyResolver.java:263)
... 17 more
[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/InternalErrorException
```
My POM file (there is a parent POM by the way)
``` <?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>
<groupId>com.project</groupId>
<artifactId>com.project.bbcode.parser</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tycho-version>0.26.0</tycho-version>
</properties>
<repositories>
<repository>
<id>project-plugins</id>
<url>file:C:/Users/Khady/temp/repository</url>
<layout>p2</layout>
</repository>
<repository>
<id>eclipse-luna</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/luna</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>projectlombok.org</id>
<url>http://projectlombok.org/mavenrepo</url>
</repository>
</repositories>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>test/main/groovy</testSourceDirectory>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>test/main/groovy</directory>
<includes>
<include>**/*.groovy</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin> <!-- enable the Tycho build extension -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.26.0</version>
<extensions>true</extensions>
</plugin>
<plugin> <!-- To compile java code -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>0.26.0</version>
<configuration>
<compilerArgs>
<arg>-warn:-raw,unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin> <!-- To run tests -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>0.26.0</version>
<configuration> <!-- for UI test -->
<useUIHarness>true</useUIHarness>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>publish-features-and-bundles</goal>
</goals>
<configuration>
<compress>false</compress>
<artifactRepositoryLocation>/C:/Users/Khady/temp/repository</artifactRepositoryLocation>
<metadataRepositoryLocation>/mypath/target/repository</metadataRepositoryLocation>
<sourceLocation>/C:/Users/Khady/temp/plugins</sourceLocation>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>verify-repository</goal>
<goal>archive-repository</goal>
</goals>
<configuration>
<compress>true</compress>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<publishArtifacts>true</publishArtifacts>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<verbose>true</verbose>
<fork>true</fork>
<compilerArguments>
<javaAgentClass>lombok.launch.Agent</javaAgentClass>
</compilerArguments>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.1-01</version>
</dependency>
<!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.3.7-01</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
</project>
```
Lombok acts a bit differently as a dependency. There are two ways of getting your lombok dependent code to work.
You can either add lombok as a dependency as shown below, then use mvn install to get it to work each time you do a mvn clean. Alternatively you can hit the Maven -> Update Project... found if you right click on the project in Eclipse every time you do a mvn clean. It should get lombok loaded back in again.
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok-maven -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven</artifactId>
<version>1.16.8.0</version>
</dependency>
I found all of this cubbersome so I looked into an alternative solution that doesn't require right click or mvn install after every mvn clean. I used delombok a powerful tool to convert lombok code to something your maven tycho compiler can digest. http://awhitford.github.io/lombok.maven/lombok-maven-plugin/delombok-mojo.html . Just add this to your pom and change the name of your source folder to src/main/lombok. Don't worry when it runs it will create/update the src/main/java folder with all delomboked code in it. So Maven will still use src/main/java as a source folder to compile all code.
<!--LOMBOK SCHBANG-->
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.8.0</version>
<executions>
<execution>
<id>delombok</id>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
<execution>
<id>test-delombok</id>
<phase>generate-test-sources</phase>
<goals>
<goal>testDelombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!--To copy delomboked classes back into src folder-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<id>copy-prod-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>src/main/java</outputDirectory>
<resources>
<resource>
<directory>target/generated-sources/delombok</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

Maven License Plugin: The parameters 'organizationName', ... are missing or invalid

I'm trying to use the maven license plugin version 1.9. I'm running the goal update-license-header however I get the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:1.9:update-file-header (default-cli) on project myproject: The parameters 'organizationName', 'inceptionYear' for goal org.codehaus.mojo:license-maven-plugin:1.9:update-file-header are missing or invalid -> [Help 1]
My pom.xml looks like this
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.9</version>
<configuration>
<verbose>false</verbose>
<addSvnKeyWords>true</addSvnKeyWords>
</configuration>
<executions>
<execution>
<id>first</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<licenseName>gpl_v3</licenseName>
<organizationName>My Organization</organizationName>
<inceptionYear>2017</inceptionYear>
<roots>
<root>src/main/java</root>
<root>src/test</root>
</roots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
You can solve this issue by adding
<organizationName>My Organization</organizationName>
<inceptionYear>2017</inceptionYear>
to the project tag of your pom.xml

maven dependency error when i start verify

I am new to Maven and am trying to create my first bdd test with jbehave, maven and thucydides on IntelliJ IDEA. When I try to click on Verify on Maven panel I receive an error.
How can I fix this? Thanks in advance!
Apache Maven 3.3.9
Error message
C:\Program Files\Java\jdk1.8.0_101\bin\java""-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition2016.2.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7537 " - Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.2.4 verify
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------------------------------------------------
[INFO] Building Sample Thucydides project 1.0-SNAPSHOT
[INFO] ---------------------------------------------------------------------
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 1.600s
[INFO] Finished at: Fri Sep 23 10:36:29 AST 2016
[INFO] Final Memory: 6M/16M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal on project bddtest: Could not resolve dependencies for project com.rostislavberezhnoy.bddtest:bddtest:jar:1.0- SNAPSHOT: Could not find artifact com.rostislavberezhnoy.bddtest:bddtest:jar:1.0-SNAPSHOT -> [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/DependencyResolutionException
Process finished with exit code 1
My pom.xml:
<?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>
<groupId>com.rostislavberezhnoy.bddtest</groupId>
<artifactId>bddtest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Sample Thucydides project</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<thucydides.version>0.9.268</thucydides.version>
<thucydides.jbehave.version>0.9.268</thucydides.jbehave.version>
<webdriver.driver>firefox</webdriver.driver>
</properties>
<dependencies>
<dependency>
<groupId>net.thucydides</groupId>
<artifactId>thucydides-core</artifactId>
<version>${thucydides.version}</version>
</dependency>
<dependency>
<groupId>net.thucydides</groupId>
<artifactId>thucydides-junit</artifactId>
<version>${thucydides.version}</version>
</dependency>
<dependency>
<groupId>net.thucydides</groupId>
<artifactId>thucydides-jbehave-plugin</artifactId>
<version>${thucydides.jbehave.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.lambdaj</groupId>
<artifactId>lambdaj</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.rostislavberezhnoy.bddtest</groupId>
<artifactId>bddtest</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.11</version>
<configuration>
<includes>
<include>**/*Test.java</include>
<include>**/Test*.java</include>
<include>**/When*.java</include>
<include>**/*TestSuite.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>net.thucydides.maven.plugins</groupId>
<artifactId>maven-thucydides-plugin</artifactId>
<version>${thucydides.version}</version>
<executions>
<execution>
<id>thucydides-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>maven2</id>
<activation>
<file>
<missing>${basedir}</missing>
</file>
</activation>
<reporting>
<plugins>
<plugin>
<groupId>net.thucydides.maven.plugins</groupId>
<artifactId>maven-thucydides-plugin</artifactId>
<version>${thucydides.version}</version>
</plugin>
</plugins>
</reporting>
</profile>
<profile>
<id>maven3</id>
<activation>
<file>
<exists>${basedir}</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.2</version>
<configuration>
<reportPlugins>
<plugin>
<groupId>net.thucydides.maven.plugins</groupId>
<artifactId>maven-thucydides-plugin</artifactId>
<version>${thucydides.version}</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Your problem is that you are refering to
<dependency>
<groupId>com.rostislavberezhnoy.bddtest</groupId>
<artifactId>bddtest</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
which isn't found.
It seems to be the same name as the artifact your Maven build is about to create.
That is, you are refering to yourself from your pom. I would consider reming that dependency and run again. It is most likely a mistake that someone introduced that dependency.
Could not find artifact com.rostislavberezhnoy.bddtest:bddtest:jar:1.0-SNAPSHOT -> [Help 1]
You need to install it in your local or deploy it to your maven repo first if you using private mvn repo.
You can refer to this to install the jar file.

How to enable java 7 in maven of Apache Storm 0.9.3

I'm currently using Apache Storm 0.9.3 in Ubuntu 14.04 LTS. I encounter that the maven compiler in Apache Storm 0.9.3 keep on using Java 6 although I had installed Java 7.
The Java version in my Ubuntu:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) Client VM (build 24.80-b11, mixed mode)
The Maven version in my Ubuntu:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_80, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-52-generic", arch: "i386", family: "unix"
Below are the error I encounter:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.storm:storm-starter:jar:0.9.3
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. # org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 694, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. # org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 660, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building storm-starter 0.9.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-remote-resources-plugin:1.2.1:process (default) # storm-starter ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # storm-starter ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # storm-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 48 source files to /home/user/storm/examples/storm-starter/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/user/storm/examples/storm-starter/src/jvm/storm/starter/bolt/PNMSTD.java:[79,19] strings in switch are not supported in -source 1.6
(use -source 7 or higher to enable strings in switch)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.856s
[INFO] Finished at: Sun May 31 06:55:27 MYT 2015
[INFO] Final Memory: 18M/51M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project storm-starter: Compilation failure
[ERROR] /home/user/storm/examples/storm-starter/src/jvm/storm/starter/bolt/PNMSTD.java:[79,19] strings in switch are not supported in -source 1.6
[ERROR] (use -source 7 or higher to enable strings in switch)
[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
Below are part of /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom related to maven:
<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>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<modules>
<module>storm-buildtools/maven-shade-clojure-transformer</module>
<module>storm-core</module>
<module>examples/storm-starter</module>
<module>external/storm-kafka</module>
<module>external/storm-hdfs</module>
<module>external/storm-hbase</module>
</modules>
<profiles>
<profile>
<id>sign</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>dist</id>
<modules>
<module>storm-dist/binary</module>
<module>storm-dist/source</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<distributionManagement>
<site>
<id>storm.maven.website</id>
<name>Storm Website</name>
<url>file:///tmp/site</url>
</site>
</distributionManagement>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>clojars</id>
<url>https://clojars.org/repo/</url>
</repository>
</repositories>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.3.18</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>v#{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.11</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<configuration>
<reportsDirectories>
<file>${project.build.directory}/test-reports</file>
<file>${project.build.directory}/surefire-reports</file>
</reportsDirectories>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>taglist-maven-plugin</artifactId>
<version>2.4</version>
<configuration>
<tagListOptions>
<tagClasses>
<tagClass>
<displayName>Todo Work</displayName>
<tags>
<tag>
<matchString>TODO</matchString>
<matchType>exact</matchType>
</tag>
<tag>
<matchString>FIXME</matchString>
<matchType>exact</matchType>
</tag>
</tags>
</tagClass>
</tagClasses>
</tagListOptions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.11</version>
<configuration>
<excludeSubProjects>false</excludeSubProjects>
<excludes>
<!-- exclude maven artifacts -->
<exclude>**/target/**</exclude>
<!-- exclude intellij projects -->
<exclude>**/*.iml</exclude>
<!-- exclude CHANGELOG, VERSION, AND TODO files -->
<exclude>**/CHANGELOG.md</exclude>
<exclude>**/README.md</exclude>
<exclude>**/README.markdown</exclude>
<exclude>**/DEVELOPER.md</exclude>
<exclude>**/BYLAWS.md</exclude>
<exclude>**/STORM-UI-REST-API.md</exclude>
<exclude>SECURITY.md</exclude>
<exclude>VERSION</exclude>
<exclude>TODO</exclude>
<!-- thrift-generated code -->
<exclude>**/src/py/**</exclude>
<!-- the following are in the LICENSE file -->
<exclude>**/src/ui/public/js/jquery-1.6.2.min.js</exclude>
<exclude>**/src/ui/public/js/jquery.cookies.2.2.0.min.js</exclude>
<exclude>**/src/ui/public/js/jquery.tablesorter.min.js</exclude>
<exclude>**/src/ui/public/js/moment.min.js</exclude>
<exclude>**/src/ui/public/js/jquery.blockUI.min.js</exclude>
<exclude>**/src/ui/public/js/url.min.js</exclude>
<exclude>**/src/ui/public/js/arbor.js</exclude>
<exclude>**/src/ui/public/js/arbor-graphics.js</exclude>
<exclude>**/src/ui/public/js/arbor-tween.js</exclude>
<exclude>**/src/ui/public/js/jquery.mustache.js</exclude>
<exclude>**/src/ui/public/js/purl.js</exclude>
<!-- generated by shade plugin -->
<exclude>**/dependency-reduced-pom.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</reporting>
Firstly you must have installed the Java 7.
As indicated in
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. # org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 694, column 21
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-report-plugin is missing. # org.apache.storm:storm:0.9.3, /home/user/.m2/repository/org/apache/storm/storm/0.9.3/storm-0.9.3.pom, line 660, column 21
Go to your home directory and cd to /.m2/repository/org/apache/storm/storm/0.9.3/ then nano or vi storm-0.9.3.pom.
Search for
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
modified the 1.6 to 1.7 if you intend to use java-7-oracle. If you're using nano, you can easily search using Ctrl+W <source>1.6</source>

OSGI example fails when maven-bundle-plugin deploys it

I'm working through an example in the book "OSGi and Apache Felix 3.0". During the maven deploy phase it fails with this message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project bookshelf-inventory-api:
Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed:
Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved:
The repository system is offline but the artifact org.codehaus.plexus:plexus-utils:jar:1.5.6 is not available in the local repository.
What is this telling me and is there a work-around?
Here is my pom.xml:
<groupId>osgi.example</groupId>
<artifactId>bookshelf-inventory-api</artifactId>
<version>1.0.0</version>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Category>inventory</Bundle-Category>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Export-Package>osgi.example.bookshelf.inventory.api</Export-Package>
</instructions>
<remoteOBR>repo-rel</remoteOBR>
<prefixUrl>file:///C:/home/src/demo/osgi/felix-3-book/releases</prefixUrl>
<ignoreLock>true</ignoreLock>
<!--
<instructions>
<Private-Package>org.foo.myproject.*</Private-Package>
<Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator>
</instructions>
-->
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<!-- releases repo -->
<repository>
<id>repo-rel</id>
<url>file:///C:/home/src/demo/osgi/felix-3-book/releases</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
The message is saying that you are trying to build in offline mode (-o) and there are a dependency that couldn't be found: org.codehaus.plexus:plexus-utils:jar:1.5.6
if is not the case and you are online getting this message, try to remove the ~/.m2/org/codehaus/plexus and try again. maybe the file was downloaded with errors.

Resources