For some technical reasons, I have to include log4j in the pom file as a local jar. I've tried:
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<scope>system</scope>
<systemPath>path_to_jar/apache-log4j-extras-1.1.jar</systemPath>
</dependency>
With and without:
<version>1.1</version>
Either way, I get the cryptic message Failed to validate POM for project, without reference to the specific failure reason. When log4j is fetched from maven repository, this is working well.
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to validate POM for project ... at ...hudson_checkout/vespa_qa/pom_local.xml
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:404)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:272)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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:601)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project ... at /....xml
at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1077)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:604)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:487)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
The jar is located in the specified folder and has read permissions. Any idea what's wrong with this dependency?
I've executed maven with "-X", and got a more helpful message:
[0] 'dependencies.dependency.version' is missing for log4j:apache-log4j-extras:jar
So I added the version again. The project still fails, with strange error messages. I searched a little further, and found that the common way to fetch og4j from the system path requires tis group id:
<groupId>org.apache.log4j</groupId>
Instead of:
<groupId>log4j</groupId>
Related
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>
I am getting the below error when building with Apache Hbase.
I am running the below mail
mvn -e clean install -DskipTests -Dhbase.api=0.98
``` [ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:akuma:jar:1.9
Reason: Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'org.kohsuke:akuma:jar': Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
org.kohsuke:akuma:jar:1.9
from the specified remote repositories:
default (http://repo1.maven.org/maven2),
central (http://repo1.maven.org/maven2),
cdh.repo.snapshots (https://repository.cloudera.com/artifactory/cloudera-repos/),
ngdata.oss-releases (http://mvnrepo.ngdata.com/content/repositories/oss-releases)
Path to dependency:
1) com.ngdata:hbase-indexer-server:jar:1.6-SNAPSHOT
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'org.kohsuke:akuma:jar': Cannot find parent: org.kohsuke:pom for project: null:akuma:jar:1.9 for project null:akuma:jar:1.9
org.kohsuke:akuma:jar:1.9
```
Thanks in advance
In the hbase indexer, for the hbase-indexer-server module, in pom, you will have
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>akuma</artifactId>
</dependency>
Looks like, while fetching the dependencies, that jar is not being fetched and not present in repository. Try to get correct version with dependencies built. Normally this is the jar needed for the indexer-server module ".m2\repository\org\kohsuke\akuma\1.9\akuma-1.9.jar"
I am running into problems using the features-maven-plugin with version ranges defined in my dependencies.
It works fine if I don't use version ranges.
Is this a known issue or am I doing something wrong?
It says :
-
[INFO] -- Start generating H:\WDP\workspace\com.company.ssb.pm.ilexamplebundle\target\classes\feature.xml --
[INFO] Generating feature org.osgi.core from org.osgi:org.osgi.core:jar:4.3.1:provided
[INFO] adding bundle org.osgi:org.osgi.core:jar:4.3.1:provided
[INFO] Generating feature api from com.company.ssb.nbda.cpm:api:jar:0.9.1:compile
[WARNING] Unable to retrieve metadata for com.company.ssb.cpm.common:pmcore:jar:[0.1,):compile, not including dependencies for it
Downloading: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
[WARNING] Unable to determine if com.company.ssb.cpm.common:pmcore:jar:[0.1,):compile is a bundle; defaulting to false
org.apache.maven.artifact.resolver.ArtifactResolutionException: Could not transfer artifact com.company.ssb.cpm.common:pmcore:jar:[0.1,) from/to artifacts (http://artifacts.ijk.company.se:8081/nexus/content/groups/public/): Illegal character in path at index 102: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
com.company.ssb.cpm.common:pmcore:jar:null
from the specified remote repositories:
artifacts (http://artifacts.ijk.company.se:8081/nexus/content/groups/public/, releases=true, snapshots=true)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:232)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:164)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:555)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.isBundle(GenerateFeaturesFileMojo.java:407)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.writeBundle(GenerateFeaturesFileMojo.java:300)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.writeBundle(GenerateFeaturesFileMojo.java:292)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.writeProjectDependencyFeatures(GenerateFeaturesFileMojo.java:256)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.populateProperties(GenerateFeaturesFileMojo.java:197)
at org.apache.karaf.tooling.features.GenerateFeaturesFileMojo.execute(GenerateFeaturesFileMojo.java:172)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
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:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.company.ssb.cpm.common:pmcore:jar:[0.1,) from/to artifacts (http://artifacts.ijk.company.se:8081/nexus/content/groups/public/): Illegal character in path at index 102: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:222)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.company.ssb.cpm.common:pmcore:jar:[0.1,) from/to artifacts (http://artifacts.ijk.company.se:8081/nexus/content/groups/public/): Illegal character in path at index 102: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1016)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:725)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 102: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
at java.net.URI.create(URI.java:859)
at org.apache.maven.wagon.providers.http.httpclient.client.methods.HttpGet.<init>(HttpGet.java:69)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:841)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:660)
... 4 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 102: http://artifacts.ijk.company.se:8081/nexus/content/groups/public/com/company/ssb/cpm/common/pmcore/[0.1,)/pmcore-[0.1,).jar
at java.net.URI$Parser.fail(URI.java:2829)
at java.net.URI$Parser.checkChars(URI.java:3002)
at java.net.URI$Parser.parseHierarchical(URI.java:3086)
at java.net.URI$Parser.parse(URI.java:3034)
at java.net.URI.<init>(URI.java:595)
at java.net.URI.create(URI.java:857)
... 10 more
[ERROR] unable to find suitable bundle for artifact 'com.company.ssb.cpm.common:pmcore:jar:[0.1,):compile'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
Maven version is 3.2.2
There is a version 0.1.0 jar in the {user home}.m2\repository\com\company\ssb\pm\common\pmcore\0.1.0
My pom.xml is
...
<dependency>
<groupId>com.company.ssb.nbda.pm</groupId>
<artifactId>api</artifactId>
<version>0.9.1</version>
</dependency>
....
...
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>2.3.5</version>
<executions>
<execution>
<id>generate-features-file</id>
<goals>
<goal>generate-features-file</goal>
</goals>
<configuration>
<karafVersion>2.3.5</karafVersion>
</configuration>
</execution>
</executions>
</plugin>
...
The pom in com/company/ssb/nbda/pm/api/0.9.1/ is as follows:
...
<groupId>com.company.ssb.nbda.pm</groupId>
<artifactId>api</artifactId>
<version>0.9.1</version>
<dependencies>
<dependency>
<groupId>com.company.ssb.pm.common</groupId>
<artifactId>pmcore</artifactId>
<version>[0.1,)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.company.ssb.cil.client</groupId>
<artifactId>service</artifactId>
<version>[0.10,)</version>
<scope>compile</scope>
</dependency>
...
Its most likely a bug. I just dug into the code of Karaf and Maven, but couldn't find the correct place in the time frame I set myself for this, but some other interesting things, have a read:
I noticed that your Karaf 2.3.5 uses maven 3.0. alpha 2. So, most likely upgrading to Karaf 3.0.1 will help you but keep in mind that the commands for feature-maven-plugin have changed. If not, file a bug report with the data from this question here: https://issues.apache.org/jira/browse/KARAF
I took a look into the GenerateFeaturesFileMojo.java.
The method thats failing there (line 407) contains the code that searches the META-INF/MANIFEST.MF for bundle informations.
This invokes the DefaultArtifactResolver.java (as you can also see in your stack trace) on a deprecated method, where the url is constructed through the ArtifactRequest.java (that you can't see in stack trace)
From there it continues into the maven code of resolving Artifacts, this is code that works well in Maven, so I assumed it would do so here, given that the Artifact information is correct.
So I started poking around the Karef code to figure out how the Artifact Objects are build in the first place but couldn't understand it easily, so I tried to figure out where the Artifacts were build and came across comments (and code) that said things like "#TODO: That works for now but it should be fixed" at places where the version came into the artifacts.
So, while this unfortunately is not a definite answer, your approach should work, if it doesn't its a bug.
I am new to maven, I want to add commons-codec jar to maven local repository , Actually I want to use this jar in the project but I get compile error which shows the jar could not find at compile-time the project pom file contains
<dependency>
<groupId>commons</groupId>
<artifactId>commons-codec</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/commons-codec-1.8.jar</systemPath>
</dependency>
and the jar file is in the lib folder in the project root , after some googling I found the I should install the jar by mvn So I execute this
C:\Program Files (x86)\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin>mvn install:commons-codec-1.8.jar -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
and then I get this error
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Required goal not found: install:commons-codec-1.8.jar in org.apache.maven.plugins:maven-install-plugin:2.2
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Required goal not found: install:commons-codec-1.8.jar in org.apache.maven.plugins:maven-install-plu
gin:2.2 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1867)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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:601)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
what's wrong here ... ?
The given goal is wrong.
mvn install:commons-codec-1.8.jar -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
it must be:
mvn install:install-file -Dfile="c:\mapsforge\mapsforge-map\lib\commons-codec-1.8.jar" -DartifactId=commons-codec -Dversion=1.8 -Dpackaging=jar -e
Apart from that i would suggest to use Maven 3.X instead of Maven 2.2.1.
I'm try to run a system my group made using Maven and Eclipse, but when I try to use mvn jetty:run, this error appears:
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:52)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:975)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:349)
at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:102)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:162)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:165)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at org.eclipse.jetty.server.Server.doStart(Server.java:228)
at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:69)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:433)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:377)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:546)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
2012-07-10 13:35:25.948:INFO::Started SelectChannelConnector#0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.
My teammate's systems can run it fine, and we basically have the same settings, repositories, and we are all using Maven2.
Any ideas as to why the error occurs?
Well, you appear to be needing the asm library. The java.lang.NoClassDefFoundError means you simply don't have the org.objectweb.asm.ClassVisitor class on your classpath. I don't know which version of the Jetty plugin you're using, (if you'd paste your pom.xml), I could be more precise.
Basically, you need one of these dependencies:
Either add this in your project's <dependencies/>:
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
Or add this as a <dependency> of your Jetty plugin:
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>8.1.0.RC4</version>
</dependency>
(Apparently, this dependency contains the ASM classes).
In the future, in order to resolve noclassdef-s, I'd recommend you look up the dependencies the class is part of via some site like:
http://www.mvnrepository.net/
http://www.jarvana.com/
http://search.maven.org/ (using 'Advanced Search')
http://www.findjar.com/
If it works for your colleagues but not for you, then it may be due to a corrupt local repository on your machine. Try renaming or deleting your local repository directory to force Maven to download your plugins and dependencies again.