cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
16624
Views
0
Helpful
8
Replies

maven plugin error

Adeel Akram
Level 1
Level 1

I have registered the application and obtained the connection data. However, in the connect class having pasted the connection data the class does not compile and I get the following error:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project TestProject: 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.

For more information about the errors and possible solutions, please read the following articles:

[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I have run the command in my root project directory and maven has built this successfully (using terminal on mac osx) but still getting the error above using netbeans when compiling the connect class.

1 Accepted Solution

Accepted Solutions

petmitch
Level 1
Level 1

Except for the groupId/artifactId error you noted above, I followed the instructions exactly and had no issue using Intellij.  I have no expertise in Netbeans, but I would first suggest checking your maven repository for the plugin noted in your original error (~/.m2/repository/org/codehaus/mojo/exec-maven-plugin) to see if it's there.  My version is 1.4.0, though I don't see it specified in the pom.xml file (it may be indirectly pulled in, or I may have it from some other project).  If you don't have it, you might try including it as a dependency in your project's pom.xml file.

View solution in original post

8 Replies 8

petmitch
Level 1
Level 1

Can you tell us whether you're building an application or a servlet, and post the snippet of code that is failing?

Hi Peter,

I am following the CS getting started guide and using the code presented on the guide and building this as a custom application on netbeans:

https://developer.cisco.com/site/context-service/discover/getting-started/

I haven't changed any of the code, I've been able to register fine (using the register class) with the credentials provided and have copied the connection data into the connection class (which I can not run and getting the error above).

I've attached the mvn -X debug log if the helps?

ADAKRAM-M-608V:testproject Adeel$ mvn -X

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)

Maven home: /usr/local/apache-maven/apache-maven-3.3.9

Java version: 1.8.0_73, vendor: Oracle Corporation

Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre

Default locale: en_US, platform encoding: UTF-8

OS name: "mac os x", version: "10.11.4", arch: "x86_64", family: "mac"

[DEBUG] Created new class realm maven.api

[DEBUG] Importing foreign packages into class realm maven.api

[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core

[DEBUG]   Imported: javax.enterprise.util.* < plexus.core

[DEBUG]   Imported: javax.inject.* < plexus.core

[DEBUG]   Imported: org.apache.maven.* < plexus.core

[DEBUG]   Imported: org.apache.maven.artifact < plexus.core

[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core

[DEBUG]   Imported: org.apache.maven.cli < plexus.core

[DEBUG]   Imported: org.apache.maven.configuration < plexus.core

[DEBUG]   Imported: org.apache.maven.exception < plexus.core

[DEBUG]   Imported: org.apache.maven.execution < plexus.core

[DEBUG]   Imported: org.apache.maven.execution.scope < plexus.core

[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core

[DEBUG]   Imported: org.apache.maven.model < plexus.core

[DEBUG]   Imported: org.apache.maven.monitor < plexus.core

[DEBUG]   Imported: org.apache.maven.plugin < plexus.core

[DEBUG]   Imported: org.apache.maven.profiles < plexus.core

[DEBUG]   Imported: org.apache.maven.project < plexus.core

[DEBUG]   Imported: org.apache.maven.reporting < plexus.core

[DEBUG]   Imported: org.apache.maven.repository < plexus.core

[DEBUG]   Imported: org.apache.maven.rtinfo < plexus.core

[DEBUG]   Imported: org.apache.maven.settings < plexus.core

[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core

[DEBUG]   Imported: org.apache.maven.usability < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core

[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core

[DEBUG]   Imported: org.codehaus.classworlds < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core

[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core

[DEBUG]   Imported: org.eclipse.aether.* < plexus.core

[DEBUG]   Imported: org.eclipse.aether.artifact < plexus.core

[DEBUG]   Imported: org.eclipse.aether.collection < plexus.core

[DEBUG]   Imported: org.eclipse.aether.deployment < plexus.core

[DEBUG]   Imported: org.eclipse.aether.graph < plexus.core

[DEBUG]   Imported: org.eclipse.aether.impl < plexus.core

[DEBUG]   Imported: org.eclipse.aether.installation < plexus.core

[DEBUG]   Imported: org.eclipse.aether.internal.impl < plexus.core

[DEBUG]   Imported: org.eclipse.aether.metadata < plexus.core

[DEBUG]   Imported: org.eclipse.aether.repository < plexus.core

[DEBUG]   Imported: org.eclipse.aether.resolution < plexus.core

[DEBUG]   Imported: org.eclipse.aether.spi < plexus.core

[DEBUG]   Imported: org.eclipse.aether.transfer < plexus.core

[DEBUG]   Imported: org.eclipse.aether.version < plexus.core

[DEBUG]   Imported: org.slf4j.* < plexus.core

[DEBUG]   Imported: org.slf4j.helpers.* < plexus.core

[DEBUG]   Imported: org.slf4j.spi.* < plexus.core

[DEBUG] Populating class realm maven.api

[INFO] Error stacktraces are turned on.

[DEBUG] Reading global settings from /usr/local/apache-maven/apache-maven-3.3.9/conf/settings.xml

[DEBUG] Reading user settings from /Users/Adeel/.m2/settings.xml

[DEBUG] Reading global toolchains from /usr/local/apache-maven/apache-maven-3.3.9/conf/toolchains.xml

[DEBUG] Reading user toolchains from /Users/Adeel/.m2/toolchains.xml

[DEBUG] Using local repository at /Users/Adeel/.m2/repository

[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/Adeel/.m2/repository

[INFO] Scanning for projects...

[DEBUG] Extension realms for project sdk-example:TestProject:jar:1.0-SNAPSHOT: (none)

[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 0.089 s

[INFO] Finished at: 2016-05-17T14:51:23-07:00

[INFO] Final Memory: 6M/245M

[INFO] ------------------------------------------------------------------------

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy.

  at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:94)

  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)

  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)

  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)

  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:497)

  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)

[ERROR]

[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/NoGoalSpecifiedException

Ok, I've not followed those instructions -- let me give it a run and see what happens. 

Thanks Peter,

Just a quick note - I believe there is an error in the guide which has not been resolved yet.

When you run the following command from the guide, the group ID and artifact ID are not correct:


mvn install:install-file -Dfile=src/main/resources/context-service-sdk-1.x.x.jar -DgroupId=com.cisco.thunderhead-sdk -DartifactId=context-service -Dversion=1.x.x -Dpackaging=jar -DpomFile=src/main/resources/context-service-sdk-pom.xml


Should be (as referenced in the POM dependency):

DgroupId=com.cisco.thunderhead

DartifactId=context-service-sdk

Yeah, I noticed that too.  I'll see if I can find out who owns that page and get it fixed.

petmitch
Level 1
Level 1

Except for the groupId/artifactId error you noted above, I followed the instructions exactly and had no issue using Intellij.  I have no expertise in Netbeans, but I would first suggest checking your maven repository for the plugin noted in your original error (~/.m2/repository/org/codehaus/mojo/exec-maven-plugin) to see if it's there.  My version is 1.4.0, though I don't see it specified in the pom.xml file (it may be indirectly pulled in, or I may have it from some other project).  If you don't have it, you might try including it as a dependency in your project's pom.xml file.

Thanks Peter, it works with Intellij! Must have been a Netbeans issue.

You only needed to wait until Netbeans indexed the repository. After it did that try again.