ubuntu - Trying to run a Maven package. Unable to find resource 'org.eclipse.m2e:lifecycle-mapping:pom:1.0.0' -
this working on windows, not on linux , don't know i'm doing wrong here.
after go maven project directory, 1 contains pom.xml file, , "mvn package -e" it, here console output:
[info] scanning projects... [info] ------------------------------------------------------------------------ [info] building functionaltests [info] task-segment: [package] [info] ------------------------------------------------------------------------ downloading: http://repo1.maven.org/maven2/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom [info] unable find resource 'org.eclipse.m2e:lifecycle-mapping:pom:1.0.0' in repository central (http://repo1.maven.org/maven2) downloading: http://repo1.maven.org/maven2/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom [info] unable find resource 'org.eclipse.m2e:lifecycle-mapping:pom:1.0.0' in repository central (http://repo1.maven.org/maven2) [info] ------------------------------------------------------------------------ [error] build error [info] ------------------------------------------------------------------------ [info] error building pom (may not project's pom). project id: org.eclipse.m2e:lifecycle-mapping reason: pom 'org.eclipse.m2e:lifecycle-mapping' not found in repository: unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0 specified remote repositories: central (http://repo1.maven.org/maven2) project org.eclipse.m2e:lifecycle-mapping [info] ------------------------------------------------------------------------ [info] trace org.apache.maven.lifecycle.lifecycleexecutionexception: unable build project plugin 'org.eclipse.m2e:lifecycle-mapping': pom 'org.eclipse.m2e:lifecycle-mapping' not found in repository: unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0 specified remote repositories: central (http://repo1.maven.org/maven2) project org.eclipse.m2e:lifecycle-mapping @ org.apache.maven.lifecycle.defaultlifecycleexecutor.verifyplugin(defaultlifecycleexecutor.java:1557) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.bindplugintolifecycle(defaultlifecycleexecutor.java:1503) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.constructlifecyclemappings(defaultlifecycleexecutor.java:1282) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.executegoal(defaultlifecycleexecutor.java:534) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.executegoalandhandlefailures(defaultlifecycleexecutor.java:387) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.executetasksegments(defaultlifecycleexecutor.java:348) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.execute(defaultlifecycleexecutor.java:180) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:328) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:138) @ org.apache.maven.cli.mavencli.main(mavencli.java:362) @ org.apache.maven.cli.compat.compatiblemain.main(compatiblemain.java:60) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:616) @ org.codehaus.classworlds.launcher.launchenhanced(launcher.java:315) @ org.codehaus.classworlds.launcher.launch(launcher.java:255) @ org.codehaus.classworlds.launcher.mainwithexitcode(launcher.java:430) @ org.codehaus.classworlds.launcher.main(launcher.java:375) caused by: org.apache.maven.plugin.invalidpluginexception: unable build project plugin 'org.eclipse.m2e:lifecycle-mapping': pom 'org.eclipse.m2e:lifecycle-mapping' not found in repository: unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0 specified remote repositories: central (http://repo1.maven.org/maven2) project org.eclipse.m2e:lifecycle-mapping @ org.apache.maven.plugin.defaultpluginmanager.checkrequiredmavenversion(defaultpluginmanager.java:293) @ org.apache.maven.plugin.defaultpluginmanager.verifyversionedplugin(defaultpluginmanager.java:205) @ org.apache.maven.plugin.defaultpluginmanager.verifyplugin(defaultpluginmanager.java:184) @ org.apache.maven.plugin.defaultpluginmanager.loadplugindescriptor(defaultpluginmanager.java:1642) @ org.apache.maven.lifecycle.defaultlifecycleexecutor.verifyplugin(defaultlifecycleexecutor.java:1540) ... 18 more caused by: org.apache.maven.project.projectbuildingexception: pom 'org.eclipse.m2e:lifecycle-mapping' not found in repository: unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0 specified remote repositories: central (http://repo1.maven.org/maven2) project org.eclipse.m2e:lifecycle-mapping @ org.apache.maven.project.defaultmavenprojectbuilder.findmodelfromrepository(defaultmavenprojectbuilder.java:605) @ org.apache.maven.project.defaultmavenprojectbuilder.buildfromrepository(defaultmavenprojectbuilder.java:251) @ org.apache.maven.plugin.defaultpluginmanager.checkrequiredmavenversion(defaultpluginmanager.java:277) ... 22 more caused by: org.apache.maven.artifact.resolver.artifactnotfoundexception: unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0 specified remote repositories: central (http://repo1.maven.org/maven2) @ org.apache.maven.artifact.resolver.defaultartifactresolver.resolve(defaultartifactresolver.java:228) @ org.apache.maven.artifact.resolver.defaultartifactresolver.resolve(defaultartifactresolver.java:90) @ org.apache.maven.project.defaultmavenprojectbuilder.findmodelfromrepository(defaultmavenprojectbuilder.java:558) ... 24 more caused by: org.apache.maven.wagon.resourcedoesnotexistexception: unable download artifact repository @ org.apache.maven.artifact.manager.defaultwagonmanager.getartifact(defaultwagonmanager.java:404) @ org.apache.maven.artifact.resolver.defaultartifactresolver.resolve(defaultartifactresolver.java:216) ... 26 more [info] ------------------------------------------------------------------------ [info] total time: 1 second [info] finished at: wed sep 04 12:38:23 eest 2013 [info] final memory: 4m/15m
this 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>com.pragmaticqa.tests</groupid> <artifactid>mailcheckertest</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <name>functionaltests</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <displayprops>target/selenium/display.properties</displayprops> </properties> <dependencies> <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-firefox-driver</artifactid> <version>2.33.0</version> </dependency> <dependency> <groupid>javax.mail</groupid> <artifactid>mail</artifactid> <version>1.4.7</version> </dependency> <dependency> <groupid>javax.activation</groupid> <artifactid>activation</artifactid> <version>1.1.1</version> </dependency> <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-java</artifactid> <version>2.33.0</version> </dependency> <dependency> <groupid>org.testng</groupid> <artifactid>testng</artifactid> <version>6.8</version> <scope>test</scope> </dependency> <dependency> <groupid>org.apache.maven.surefire</groupid> <artifactid>surefire</artifactid> <version>2.5</version> <type>pom</type> </dependency> <dependency> <groupid>net.sf.opencsv</groupid> <artifactid>opencsv</artifactid> <version>2.3</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.eclipse.m2e</groupid> <artifactid>lifecycle-mapping</artifactid> <version>1.0.0</version> <configuration> <lifecyclemappingmetadata> <pluginexecutions> <pluginexecution> <pluginexecutionfilter> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <versionrange>[1.0,)</versionrange> </pluginexecutionfilter> <action> <execute /> </action> </pluginexecution> </pluginexecutions> </lifecyclemappingmetadata> </configuration> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>selenium-maven-plugin</artifactid> <version>2.3</version> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.5</version> <configuration> <includes> <include>**/*test*.java</include> </includes> <systempropertyvariables> </systempropertyvariables> </configuration> <executions> <execution> <phase>integration-test</phase> <goals> <goal>test</goal> </goals> <configuration> <skip>true</skip> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
and output of "mvn -version"
apache maven 2.2.1 (rdebian-1) java version: 1.6.0_27 java home: /usr/lib/jvm/java-6-openjdk/jre default locale: en_us, platform encoding: utf-8 os name: "linux" version: "2.6.32-45-generic" arch: "i386" family: "unix"
the root cause of problem non-existing plugin lifecycle-mapping
unable download artifact repository org.eclipse.m2e:lifecycle-mapping:pom:1.0.0
the solution problem here: m2e lifecycle-mapping not found
edit
suggestion avoid using m2eclipse:
define plugin lifecycle-mapping
in dev
profile , activate profile in eclipse. when run on ci-server (without dev
profile): plugin won't implied.
add pom.xml:
<profiles> <profile> <id>dev</id> <build> <plugins> <plugin> <groupid>org.eclipse.m2e</groupid> <artifactid>lifecycle-mapping</artifactid> <version>1.0.0</version> <configuration> <lifecyclemappingmetadata> <pluginexecutions> <pluginexecution> <pluginexecutionfilter> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <versionrange>[1.0,)</versionrange> </pluginexecutionfilter> <action> <execute /> </action> </pluginexecution> </pluginexecutions> </lifecyclemappingmetadata> </configuration> </plugin> </plugins> </plugin> </build> </profile> </profiles>
you need remove plugin default build section.
the dev
profile won't active default, plugin won't run default.
to run build plugin need activate profile. there different way of doing this:
- adding
-pdev
mvn command line - find way under eclipse activate profile (no idea how it, i'm not eclipse user)
- make dev profile active default in settings.xml (under $user_home/.m2/settings.xml - if file don't exists: create hand): useful activate dev profile on developer machine.
to it, add following line in settings.xml
<settings> ... <activeprofiles> <activeprofile>dev</activeprofile> </activeprofiles> </settings>
note : last solution, must ensure maven installation used eclipse use settings.xml (once again, i'm not eclipse user... don't know how ensure that)
Comments
Post a Comment