unresolveable build extensions maven nar plugin - c++

I swear this is a very simple question, but somehow I just cannot figure it out. It's simply a hello world in c++. And i am using nar-maven-plugin.
I've looked into other questions but still the problem is unsolved.
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myapp</groupId>
<artifactId>myapp</artifactId>
<packaging>nar</packaging>
<version>1.0-SNAPSHOT</version>
<name>myapp</name>
<properties>
<skipTests>true</skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-marven-plugin</artifactId>
<version>3.5.1</version>
<extensions>true</extensions>
<configuration>
<os>Linux</os>
<skipTests>true</skipTests>
<cpp>
<name>g++</name>
<debug>true</debug>
<options>
<option>-g</option>
<option>-Wall</option>
</options>
</cpp>
<linker>
<name>g++</name>
</linker>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>cppunit</groupId>
<artifactId>cppunit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
I've downloaded one example application of nar maven plugin, and it worked well. But with my own application it cannot.
[INFO] Scanning for projects...
[WARNING] The POM for com.github.maven-nar:nar-marven-plugin:jar:3.5.1 is missing, no dependency information available
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin com.github.maven-nar:nar-marven-plugin:3.5.1 or one of its dependencies could not be resolved: Failure to find com.github.maven-nar:nar-marven-plugin:jar:3.5.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced #
[ERROR] Unknown packaging: nar # line 6, column 14
[ERROR] 'dependencies.dependency.version' for cppunit:cppunit:jar is missing. # line 44, column 17
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project myapp:myapp:1.0-SNAPSHOT (/home/liu/Downloads/mavenproj/myapp/pom.xml) has 3 errors
[ERROR] Unresolveable build extension: Plugin com.github.maven-nar:nar-marven-plugin:3.5.1 or one of its dependencies could not be resolved: Failure to find com.github.maven-nar:nar-marven-plugin:jar:3.5.1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
[ERROR] Unknown packaging: nar # line 6, column 14
[ERROR] 'dependencies.dependency.version' for cppunit:cppunit:jar is missing. # line 44, column 17
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
thanks a lot ahead!

Related

Error in pom.xml file directly after creating project using AWS Toolkit

I tried to work on some AWS S3 implementations and wanted to start off with the provided examples of the AWS Toolkit for Eclipse.
I created the project as following:
Project Configuration
Then right afterwards i get an error in the pom.xml right at line 1 and 13.
<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.amazonaws</groupId>
<artifactId>samples</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.497</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-kinesis-client</artifactId>
<version>1.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Failure to transfer com.amazonaws:aws-java-sdk-swf-libraries:jar:1.11.22 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the
update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.amazonaws:aws-java-sdk-swf-libraries:jar:1.11.22 from/to central (https://
repo.maven.apache.org/maven2): The operation was cancelled. org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer com.amazonaws:aws-java-sdk-swf-libraries:jar:1.11.22 from
https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error:
Could not transfer artifact com.amazonaws:aws-java-sdk-swf-libraries:jar:1.11.22 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. at
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:240) at
org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:208) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:563) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:481) at
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:
224) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338) at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:202) at
org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:212) at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:185) at
org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:116) at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:628) at
org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:525) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$1(ProjectRegistryManager.java:489) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:488) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:349) at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:296) at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:259) at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$4.run(ProjectConfigurationManager.java:528) at
org.eclipse.m2e.core.internal.embedder.AbstractRunnable.call(AbstractRunnable.java:26) at org.eclipse.m2e.core.internal.embedder.AbstractRunnable.call(AbstractRunnable.java:1) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at
org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1336) at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.enableMavenNature(ProjectConfigurationManager.java:525) at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createSimpleProject(ProjectConfigurationManager.java:709) at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createSimpleProject(ProjectConfigurationManager.java:662) at
com.amazonaws.eclipse.core.maven.MavenFactory.createMavenProject(MavenFactory.java:76) at
com.amazonaws.eclipse.sdk.ui.wizard.NewAwsJavaProjectWizard.doFinish(NewAwsJavaProjectWizard.java:215) at
com.amazonaws.eclipse.core.plugin.AbstractAwsProjectWizard$1$1.execute(AbstractAwsProjectWizard.java:63) at
org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:110) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295) at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131) at
com.amazonaws.eclipse.core.plugin.AbstractAwsProjectWizard$1.run(AbstractAwsProjectWizard.java:70) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:
122)
Please check you settings.xml in Maven... this is to check if Maven would look for private repository or public one & make sure if it's a private repo like Nexus, you're connected to VPN..
then right click on the project & then Maven, the check force update of snapshots/ release & click OK..

unknown packaging nar - nar-maven-plugin

I use Maven to manage my Java projects build but sometimes I have projects written in C or C++ langage and I would like to use Maven too so it will be easier to manage those projects.
It seems the nar-maven-plugin should do the job. I tried to create an HelloWorld project just to test it. I thought it will be really simple as it is generally with Maven.
My pom.xml
<project
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.sample</groupId>
<artifactId>helloworld-cplusplus-sample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>nar</packaging>
<name>Helloworld</name>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
And i have the following error
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unknown packaging: nar # line 7, column 14
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.sample:helloworld-cplusplus-sample:0.0.1-SNAPSHOT (D:\local\workspaces\TEST\HelloWorl
dMaven\pom.xml) has 1 error
[ERROR] Unknown packaging: nar # line 7, column 14
[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/ProjectBuildingException
I'm using Maven 3.3.1.
I forced the download of nar-maven-plugin in my local repository using "mvn dependency:get ..." but it doesn't change anything.
When a plugin adds a new packaging type, you must add <extensions>true</extensions> to its definition:
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions> <!-- This needs to be present for a new packaging -->
<configuration>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
As already answered, ;)
link.exe is part of Microsoft Visual Studio, which is what NAR
typically uses under the hood to compile C++ code on Windows.
Try with
<linker>
<name>g++</name>
</linker>
in your nar plugin configuration if you have MinGW or something other than MSVS.

Maven cannot run program "link"

I am trying to build a simple C++ project with maven and the nar-maven-plugin, but I'm getting the following error:
Failed to execute goal
com.github.maven-nar:nar-maven-plugin:3.2.3:nar-validate
(default-nar-validate) on project it0015-cpp-executable: Could not
launch cmd.exe /X /C "link /?": Error while executing process. Cannot
run program "link": CreateProcess error=2, The system cannot find the
file specified -> [Help 1]
I am using Windows 8.1. Does anyone have ideas on how to investigate this issue?
you should specify the linker you are using.
For me, i'm using MinGW so i update my user path (environment variable) with C:/MinGW/bin and in the nar-maven-plugin i specify the linker name to g++
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<linker>
<name>g++</name>
</linker>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
Now you can launch "mvn validate" to check if it works

SpringJUnit4ClassRunner - Reloads Context for every test even though same context used

This is the base class of our unit tests:
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration("/spring/test-context.xml")
public abstract class BaseUnitTest {}
All unit tests extend this class.
When I run the tests locally in eclipse (using Run As > Unit Test) , the tests run in about 5 seconds since the same context is shared by all tests and it is loaded only once.
However, when I run them using the mvn test target it takes about 5 minutes. After looking at the logs, I see that the application context is being loaded for every test.
It takes the same time (5 mins) when we run it on our Jenkins CI server.
Not sure what's going on. In spring docs, it states that the appContext should be reused even with maven, but thats not the case here.
Any help would be appreciated.
UPDATE :
I ran mvn with debug flags on and I see that a new JVM is spawned for each test:
Forking command line: cmd.exe /X /C "java -Xverify:none -jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefirebooter8169952914558366417.jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire8550033206398936560tmp S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire_05655453605766528120tmp"
Forking command line: cmd.exe /X /C "java -Xverify:none -jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefirebooter4002024477779069323.jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire6735432532690834115tmp S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire_17783676008756503456tmp"
Forking command line: cmd.exe /X /C "java -Xverify:none -jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\ 7874269889863176184.jar S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire2050758518148174678tmp S:\git\picaxo21\picaxo\picaxoService\target\surefire\surefire_27591156970671336255tmp"
I am using forkCount=1 and reuseForks=true so I am not sure why this is happening. any clues?
Parent POM :
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
.....
</parent>
<groupId>...</groupId>
<artifactId>picaxo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>.....</name>
<description>Build All Modules</description>
<modules>
<module>picaxoService</module>
</modules>
<scm>
....
</scm>
<properties>
<pmd.include.tests>true</pmd.include.tests>
<findbugs.plugin.version>3.0.0</findbugs.plugin.version>
<fb.threshold>Low</fb.threshold>
<fb.includeTests>true</fb.includeTests>
<fb.effort>Max</fb.effort>
<fb.failOnError>false</fb.failOnError>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>true</skipTests>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<skipTests>${skipTests}</skipTests>
<reuseForks>true</reuseForks>
<forkCount>1</forkCount>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</build>
Found the problem.
Apparently forkMode for surefire plugin was defaulting to pertest hence was spawning a new JVM for each test. Explicitly Setting it to once in the plugin configuration solved the issue.

Non-resolvable parent POM for Could not find artifact and 'parent.relativePath' points at wrong local POM

I am new to maven.
I have one project which I try to build with the maven3.
When I run the command mvn -X clean install I got the error.
[root#localhost]# mvn -X clean install
Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: /usr/local/maven
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-279.9.1.el6.x86_64", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml
[DEBUG] Using local repository at /root/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /root/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Could not find metadata com.test.ctrl:ctrl-build:0.0.17-SNAPSHOT/maven-metadata.xml in local (/root/.m2/repository)
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openstack:openstack-rhel-rpms:2012.1-SNAPSHOT: Could not find artifact com.test.ctrl:ctrl-build:pom:0.0.17-SNAPSHOT and 'parent.relativePath' points at wrong local POM # org.openstack:openstack-rhel-rpms:2012.1-SNAPSHOT, /root/test/devenv/openstack-rhel/pom.xml, line 8, column 13
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR]
[ERROR] The project org.openstack:my-tar:2012.1-SNAPSHOT (/root/test/devenv/mytar/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openstack:openstack-rhel-rpms:2012.1-SNAPSHOT: Could not find artifact com.test.ctrl:ctrl-build:pom:0.0.17-SNAPSHOT and 'parent.relativePath' points at wrong local POM # org.openstack:openstack-rhel-rpms:2012.1-SNAPSHOT, /root/test/devenv/openstack-rhel/pom.xml, line 8, column 13 -> [Help 2]
org.apache.maven.model.resolution.UnresolvableModelException: Could not find artifact com.test.ctrl:ctrl-build:pom:0.0.17-SNAPSHOT
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:159)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:813)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:664)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:310)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:232)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:410)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:379)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:343)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.test.ctrl:ctrl-build:pom:0.0.17-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:155)
... 22 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.test.ctrl:ctrl-build:pom:0.0.17-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
... 26 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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I check the pom.xml but cant understand what was the problem.
Some lines from my pom.xml is as below.
1 <?xml version="1.0"?>
2 <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4 <modelVersion>4.0.0</modelVersion>
5
6 <parent>
7 <groupId>org.openstack</groupId>
8 <artifactId>openstack-rhel-rpms</artifactId>
9 <version>2012.1-SNAPSHOT</version>
10 <relativePath>../openstack-rhel</relativePath>
11 </parent>
12
13 <groupId>org.openstack</groupId>
14 <artifactId>my-tar</artifactId>
15 <version>2012.1-SNAPSHOT</version>
16 <packaging>pom</packaging>
17 <name>my tar</name>
18
I also check the solution on some question in stackoverflow like Non-resolvable parent POM: Could not find artifact but couldnt help to solve the problem.
If you need more information related to this question, let me know.
I faced the same issue. Setting relative path of the parent in module projects solved the issue.
Use <relativePath>../Parent Project Name/pom.xml</relativePath>
You need to have the file /root/test/devenv/openstack-rhel/pom.xml
This file need to have the followings elements:
<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>org.openstack</groupId>
<artifactId>openstack-rhel-rpms</artifactId>
<version>2012.1-SNAPSHOT</version>
<packaging>pom</packaging>
</project>
I encountered an issue like this using the Maven Release Plugin. Resolving using relative paths (i.e. for the parent pom in the child module ../parent/pom.xml) did not seem to work in this scenario, it keeps looking for the released parent pom in the Nexus repository. Moving the parent pom to the parent folder of the module resolved this.
Make sure you have settings.xml. I had the same problem when I've deleted it by mistake.
In pom.xml file of the project,
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>X.X.X.RELEASE</version>
<relativePath> ../PROJECTNAME/pom.xml</relativePath>
</parent>
Pointing relativepath to the same MAVEN project POM file solved the issue for me.
In my case, the reason was a simple typo.
<parent>
<groupId>org.sringframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
</parent>
A missing character in the groupId org.s(p)ringframework lead to this error.
We had the same issue.
The parent pom file was available in our local repository, but maven still unsuccessfully tried to download it from the central repository, or from the relativePath (there were no files in the relative path).
Turns out, there was a file called "_remote.repositories" in the local repository, which was causing this behavior. After deleting all the files with this name from the complete local repository, we could build our modules.
Any way you mentioned /root/.m2/settings.xml.
But in my Case i missed the settings.xml to configure in the maven preferences.
so that maven will search for the relative_path pom.xml from the remote_repository which is configured in settings.xml
Give the relative path URL value to the pom.xml file
../parentfoldername/pom.xml
In my case I had to enter proxy configuration to maven settings file and run mvn verify from command line. Somehow eclipse was still givin the same timeout error when trying to download the dependency.