Specify dependency version for Maven Archetype plugin - maven

I am currently working with Maven 3.3.3, from which the mvn.bat file has been removed. The recommended and only way to run Maven is now through the mvn.cmd file.
I am using a custom archetype that calls the maven-invoker plugin for some operation. Note that the invoker plugin is a dependency of the Maven archetype plugin.
On archetype:generate, the invoker is called and throws an error :
Error configuring command-line. Reason: Maven executable not found at: <MAVEN_PATH>\bin\mvn.bat
This issue seems to have been fixed with the release 2.2 of the invoker, but the last version of maven-archetype-plugin still uses an old version of it.
How can I specify, in my archetype's POM, the version of the invoker plugin to use ?
For now, I've tried to configure the plugin by adding this code into the archetype's POM file, but it had no effect, and didn't fixed the error.
<plugin>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>maven-archetype</artifactId>
<version>2.4</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
EDIT 1 :
Here's the filtered stack trace.
[INFO] Invoking post-archetype-generation goals: com.company.my-custom-maven-plugin:uuid-generator
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.777 s
[INFO] Finished at: 2016-02-08T15:09:19+01:00
[INFO] Final Memory: 18M/210M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: Cannot run additions goals. Error configuring command-line. Reason: Maven executable not found at: <MAVEN_PATH>\bin\mvn.bat -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: Cannot run additions goals.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: org.apache.maven.plugin.MojoExecutionException: Cannot run additions goals.
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.invokePostArchetypeGenerationGoals(CreateProjectFromArchetypeMojo.java:241)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:219)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.apache.maven.shared.invoker.MavenInvocationException: Error configuring command-line. Reason: Maven executable not found at: <MAVEN_PATH>\bin\mvn.bat
at org.apache.maven.shared.invoker.DefaultInvoker.execute(DefaultInvoker.java:105)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.invokePostArchetypeGenerationGoals(CreateProjectFromArchetypeMojo.java:237)
... 23 more
Caused by: org.apache.maven.shared.invoker.CommandLineConfigurationException: Maven executable not found at: <MAVEN_PATH>\bin\mvn.bat
at org.apache.maven.shared.invoker.MavenCommandLineBuilder.findMavenExecutable(MavenCommandLineBuilder.java:597)
at org.apache.maven.shared.invoker.MavenCommandLineBuilder.build(MavenCommandLineBuilder.java:68)
at org.apache.maven.shared.invoker.DefaultInvoker.execute(DefaultInvoker.java:101)
... 24 more
[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/MojoExecutionException

This is a bug of the Maven Archetype Plugin: the JIRA issue is ARCHETYPE-488. It affects all versions of the plugin ≤ 2.4 and is resolved with version 3.0.0.
Quoting Jörg Hohwiller in the linked issue (dated 08-Jan-2016 13:47):
Is there a workaround for it?
Yep. Just create a copy of "mvn.cmd" that you call "mvn.bat" in MAVEN_HOME/bin.
So a possible work-around with 2.4 or earlier is just to make a copy of the mvn executable with the other name.

The bug references by #Tunaki has been fixed (posting for reference) and the pom.xml needs:
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.4</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>

Related

Maven Failsafe plugin cannot find class

The project where I'm working on has several modules and one of the modules is integration_test, integrations test for all the others modules. This is a weird architecture for me and I'm not sure if I'm handling this situation correctly.
We haven't continous integration, right now we are running the suite test from Eclipse but we want to run it from a continuos integration server. I have been working on update our POM to execute it from the command line. I will include a sample project below because paste here the classes I think is not enough.
I followed the Maven Failsafe plugin documentation, but when I execute mvn clean verify -P integration-test I get Cannot find class in classpath: TestApiMain
I think this is because is trying to running that class before it's compiled but I don't know how to run the integration test after all other modules are actually compiled. I also want to implement Jacoco for test coverage. Reading the following guide to implement Jacoco I think I'm close:
https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/
Exception when execute mvn clean verify -P integration-test:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.20.1:verify (integration-test) on project root: There are test failures.
[ERROR]
[ERROR] Please refer to /home/francisco_aguiar/repos/sample_project/target/failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR]
[ERROR] Cannot find class in classpath: TestApiMain
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:673)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:535)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:280)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1124)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:954)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:832)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Sample_project: https://drive.google.com/file/d/1Ow--OYz4LzxNZvoBPtb5Ub2khXSR74w3/view?usp=sharing
You defined plugin failsafe in parent pom in build/plugins section. It means every module, including parent, in phase integration-test must call failsafe(TestApiMain.class).
It will not work, because TestApiMain is defined in last module integration_test
You should move failsafe definition to integration_test/pom.xml to section build/plugins
For anyone who reads this who has teh project configured correctly but still has a classes not found then see if the following applies.
When upgrading to 3.0.0-M5 this plugin can fail to find classes from a transitive dependency. One simple fix instead of rolling back to 3.0.0-M4 is to add classesDirectory to your plugin configuration
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Could not find metadata {xxx} maven-metadata.xml in local

Getting this error on this one dependency. It worked yesterday when I stopped for the day, and then did not work today when I started again. I didn't shutdown any apps, let alone the computer. Other dependencies are working fine, and I can see that the supposedly missing file is in the correct directory in the local repository.
Here's a view of the file in the repository
$ cd /c/users/thomsen.dean/.m2/repository/oes-common/oes-common/
thomsen.dean#US-PRECXIVJZ MINGW64 /c/users/thomsen.dean/.m2/repository/oes-common/oes-common
$ ls -l
total 9
-rw-r--r-- 1 thomsen.dean 1049089 304 Oct 8 2014 maven-metadata.xml
drwxr-xr-x 1 thomsen.dean 1049089 0 Sep 8 10:44 RELEASE/
-rw-r--r-- 1 thomsen.dean 1049089 555 Sep 8 10:44 resolver-status.properties
You can see that the mave-metadata.xml file is present, and here's the content of the file.
$ cat maven-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>oes-common</groupId>
<artifactId>oes-common</artifactId>
<versioning>
<release>RELEASE</release>
<versions>
<version>RELEASE</version>
</versions>
<lastUpdated>20141008090909</lastUpdated>
</versioning>
</metadata>
Here's the maven command and the error
The error is: "Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean.m2\repository)". But you can see from the above that the file exists and does not appear to be corrupted.
$ mvn clean install -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CCDRCDWeb 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.403 s
[INFO] Finished at: 2017-09-08T13:21:05-06:00
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project CCDRCDWeb: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE: Failed to read artifact descriptor for oes-common:oes-common:jar:RELEASE: Failed to resolve version for oes-common:oes-common:jar:RELEASE: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project CCDRCDWeb: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project CCDRCDWeb:CCDRCDWeb:war:0.0.1-SNAPSHOT: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:180)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at oes-common:oes-common:jar:RELEASE
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for oes-common:oes-common:jar:RELEASE
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:245)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
... 26 more
Caused by: org.eclipse.aether.resolution.VersionResolutionException: Failed to resolve version for oes-common:oes-common:jar:RELEASE: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:300)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:231)
... 33 more
Caused by: org.eclipse.aether.transfer.MetadataNotFoundException: Could not find metadata oes-common:oes-common/maven-metadata.xml in local (C:\Users\thomsen.dean\.m2\repository)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:247)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:205)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:237)
... 34 more
[ERROR]
[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
Here a two dependencies from the pom.xml.
This one works
<dependency>
<groupId>oes-dataobjects</groupId>
<artifactId>oes-dataobjects</artifactId>
<version>RELEASE</version>
<scope>provided</scope>
</dependency>
This one does not work
<dependency>
<groupId>oes-common</groupId>
<artifactId>oes-common</artifactId>
<version>RELEASE</version>
<scope>provided</scope>
</dependency>
I have tried to delete the directory in the local repository and recreate it.
I have edited the file to make sure it was accessible.
I can't figure out what maven is complaining about.
Hopefully someone out there has seen this before and can explain what is going wrong.

Maven: Error putting Weblogic libs into local repository

I want to put Weblogic libs into local repository (Installing and Configuring Maven for Build Automation and Dependency Management) I have the Weblogic version is 12.1.2 installed in my workstation.
I run this command:
mvn -X com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=C:\Oracle\product\11.2.0\client_x86 -Doracle-maven-sync.testingOnly=false
but I got this error:
[ERROR] Failed to execute goal com.oracle.maven:oracle-maven-sync:12.2.1-2-0:push (default-cli) on project standalone-pom: Synchronization execution failed:
No resources were processed by the sync plugin -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.oracle.maven:oracle-maven-sync:12.2.1-2-0:push (default-cli)
on project standalone-pom: Synchronization execution failed
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: org.apache.maven.plugin.MojoExecutionException: Synchronization execution failed
at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:242)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: com.oracle.maven.sync.SyncException: No resources were processed by the sync plugin
at com.oracle.maven.sync.ODMPusher.handleError(ODMPusher.java:458)
at com.oracle.maven.sync.ODMPusher.push(ODMPusher.java:117)
at com.oracle.maven.sync.ODMPushMojo.execute(ODMPushMojo.java:240)
... 22 more
[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/MojoExecutionException
C:\Users\carbonell>
This may be an old thread, but the answer may still help somebody
Cause:
Issue was happening due to wrong variable -Doracle-maven-sync.oracleHome
Solution:
Please change the flag to -DoracleHome:
mvn -X com.oracle.maven:oracle-maven-sync:push -DoracleHome="your Oracle home dir" -Doracle-maven-sync.testingOnly=false
Your ORACLE_HOME points to the Oracle data base driver. I think you need to point it to the Oracle Middleware (aka Weblogic) directory.
Check that you refer to weblogic's libraries from maven as a dependency in the following way:
<dependency>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-server-pom</artifactId>
<version>12.1.2-0-0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Then, you must try this, from this reference:
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=%MW_HOME% -Doracle-maven-sync.testingOnly=false
If nothing works, see also this very related issue

Maven: Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin

I'm trying to create a Web Application Project with Maven as described here but I keep getting the following error
mvn archetype:create
-DgroupId=ru.jofsey
-DartifactId=example
-DarchetypeArtifactId=maven-archetype-webapp
-DinteractiveMode=false
-e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.373 s
[INFO] Finished at: 2017-02-18T14:31:49+03:00
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.0 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [Help 1]
org.apache.maven.plugin.MojoNotFoundException: Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.0 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:290)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:238)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89)
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: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)
[ERROR]
[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/MojoNotFoundException
As per the following release note, the plugin has removed support for the archetype-create goal. It was already marked as deprecated in recent versions of the plugin, and instead you should use the archetype:generate goal. The Jira issue (https://issues.apache.org/jira/browse/ARCHETYPE-437) mentions the following:
It's time to finally remove the support for the old create goal. For users still using it, it should fail the build with a message about using the generate goal instead.
The plugin documentation also removed any mentioning of archetype:create.
Using mvn archetype:generate instance of mvn archetype:create
mvn archetype:generate

Maven with Spark, Error message by the Java execution

I use Eclipse to run my Spark code and use tool Maven in Eclipse to build the dependencies.
Currently I have the situation, when I have to run my code not from Eclipse platform, but from console (bash). I upload and install Maven local on my machine and was playing with the different simple examples. My Maven folder is in Downloads repository. All standard examples are going very well, I have got a right output. All introductions I have found on this site.
Now I want also execute a spark code. After I have placed my Java file with the spark code in the directory, where I have other files, and updated pom.xml, I couldn't build my jar file. I have got the next error:
user#user-HP-ProBook-6570b:~/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app$ mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # CTI ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) # CTI ---
[INFO] Compiling 1 source file to /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.728s
[INFO] Finished at: Mon Oct 26 15:18:52 CET 2015
[INFO] Final Memory: 14M/167M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
[ERROR] /home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project CTI: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/home/user/spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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
How I understand, is everything wrong with my Spark version. I use currently spark 1.4.0 version. I also post my pom.xml 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>Prototype</groupId>
<artifactId>CTI</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>
</project>
Regarding the documentation in the link at the bottom of error message it is not a error of maven, but something wrong is with plugin.
According to you error log, you need to set your java compiler version in maven to the corresponding java version you are using (1.7 or 1.8). It seems that your maven is using a old version of Java (1.3)
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
This is the line that gave the error up :
spark-1.4.0-bin-hadoop2.6/apache-maven-3.3.3/my-app/src/main/java/app/SimpleApp.java:[12,11] error: generics are not supported in -source 1.3

Resources