I'm about to work on a Scala/SBT project that requires Mechanical Turk java API. Mturk provides instruction how to install dependency in Java with Ant.
I thought I could just drop ready jar (downloaded from Maven) into the /lib and that should work in my Scala project but I get dependency errors when compiling. Is this because jar is not packaged with org.apache.commons?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory
UPDATE:
Tried adding this dependency to SBT.
libraryDependencies += "net.ettinsmoor" % "java-aws-mturk" % "1.6.2"
Error:Error while importing SBT project:
...
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:745)
[error] sbt.ResolveException: unresolved dependency: org.apache.commons#not-yet-commons-ssl;0.3.7: not found
[error] unresolved dependency: apache-xerces#xercesImpl;2.9.1: not found
[error] unresolved dependency: apache-xerces#resolver;2.9.1: not found
[error] unresolved dependency: apache-xerces#xml-apis;2.9.1: not found
[error] Use 'last' for the full log.
See complete log in /Users/marcin/Library/Logs/IdeaIC14/sbt.last.log
You have to add the MTurk dependency to your sbt build file (build.sbt). Like that:
libraryDependencies += "org.clojars.zaxtax" % "java-aws-mturk" % "1.6.2"
Related
To fix the org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [com.microsoft.sqlserver.jdbc.SQLServerDriver] error i added this dependency to my pom:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.1.0.jre7</version>
</dependency>
which is the open code dependency for a SQLServer connection driver, but when i put it, an error my pom.xml appears:
Missing artifact org.codehaus.jackson:jackson-mapper-asl:jar:2.8.1
UPDATED:
If i run the app anyway, the log console shows this trace:
15:42:28,432 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 50) MSC000001: Failed to start service jboss.persistenceunit."vp301b-ear.ear/vp301b.war#unidadPersistencia": org.jboss.msc.service.StartException in service jboss.persistenceunit."vp301b-ear.ear/vp301b.war#unidadPersistencia": java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ClassLoadingException
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_80]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_80]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ClassLoadingException
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1404)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.ClassLoadingException from [Module "deployment.vp301b-ear.ear.vp301b.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 14 more
When i try to compile it using mvn comile, this is the result:
Failed to execute goal on project vp301b-war: Could not resolve dependencies for project es.xunta.amtega.vp301b:vp301b-war:war:1.0-SNAPSHOT: Failure to find org.codehaus.jackson:jackson-mapper-asl:jar:2.8.1 in http://nexus.xunta.local/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of amtega has elapsed or updates are forced -> [Help 1]
[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/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :vp301b-war
As already noted by khmarbaise, the problem is that jackson-mapper-asl-2.8.1.jar is not available in your repository. However I see that mssql-jdbc-6.1.0.jre7.jar has a transitive dependency on version 1.9.2, not 2.8.1, of jackson-mapper-asl so I guess that something you stated is wrong (maybe you were making many attempts). I suggest to try with version 6.4.0.jre7 of the JDBC driver because it doesn't depends on jackson-mapper-asl at all and is the latest jre7-based version available.
Also note that a JDBC driver should not be included in the classpath of your war but in the classpath of the application server (I'm assuming that your web-app accesses the DB in the proper way, that is through a server-provided connection pool, not through DriverManager); this means that the driver should not be a compile-scope dependency in your POM.
ENVIRONMENT
Jenkins 2.23
SonarQube plugin 2.4.4
SonarQube 6.0
Java plugin 4.2
Findbugs plugin 3.4.3
Clirr 1.3
(some other plugins, probably not relevant for this issue, but feel free to ask in the comments and I´ll edit the question)
I have a multi-module Maven project with one root module (pom packaging, no code) and several child modules (jar packaging, code). I´m running SonarQube analysis in a Maven job in Jenkins.
PROBLEM DESCRIPTION
Analysis worked ok in SQ 5.x. Since upgrading to SQ 6.0, the analysis fails:
the analysis on the child modules succeeds
the analysis on the root module fails with error:
[ERROR] Failed to execute goal
org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on
project root:
org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
-> [Help 1]
ALREADY TRIED
excluding the root module from analysis --> results in Maven error
Unable to determine structure of project. Probably you use Maven
Advanced Reactor Options with a broken tree of modules. "foo" is
orphan
Findbugs plugin 3.4.4 from https://github.com/SonarQubeCommunity/sonar-findbugs/releases (as hinted in API incompatibility with SonarQube 5.6 and Java Analyzer 4.0 with Findbugs 3.3 or Cobertura 1.6.3) --> same error
DEBUG LOGGING
Maven with -e and -X
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project root: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource; -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project root: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
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.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 31 more
Caused by: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
at org.sonar.plugins.clirr.ClirrSensor.saveIssues(ClirrSensor.java:94)
at org.sonar.plugins.clirr.ClirrSensor.analyse(ClirrSensor.java:76)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:184)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:78)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
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.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
... 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/MojoExecutionException
QUESTION
Is this a configuration issue at my end? Or is there an issue with SonarQube or any of the plugins?
I will also accept answers that let me exclude the codeless root module as a workaround, without any interference for the child modules that have it as a parent.
The lines that might have raised your attention are the following ones:
Caused by: java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.findResourceByClassName(Ljava/lang/String;)Lorg/sonar/api/resources/Resource;
at org.sonar.plugins.clirr.ClirrSensor.saveIssues(ClirrSensor.java:94)
You must uninstall the Clirr plugin: it is not compatible with SonarQube 6.0.
To be honest, maybe this is not exactly the solution to your problem. But let me describe where I ran into a similar problem that matches your following description:
Unable to determine structure of project. Probably you use Maven Advanced Reactor Options with a broken tree of modules. "foo" is orphan.
I had changed my maven build to ci friendly as described by maven here.
Generally, my maven build was running fine until I added sonarqube check. Then I got the above-described message. It took a while to finde the problem and it was quite tricky.
By the way, I had a multiple module maven project running and the problem was that in my parent pom I was referring to the pom.xml instead of the folder.
<modules>
<module>modules/module1</module>
<!-- the reference to the pom.xml is the problem.
and will cause sonar to fail -->
<module>modules/module2/pom.xml</module>
</modules>
When I call Jenkins build job, It throw following error and job failed.*
Can anyone have saw this error?
Jenkins version: 1.642.1
Sonar version: 5.4 (Java plugin 3.5)
Here is the error info:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project ods-replicator: Unable to register extension org.sonar.plugins.java.JavaSquidSensor: Lorg/sonar/api/checks/NoSonarFilter;: org.sonar.api.checks.NoSonarFilter -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project ods-replicator: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
......
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 31 more
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.plugins.java.JavaSquidSensor
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:241)
...
... 34 more
Caused by: java.lang.NoClassDefFoundError: Lorg/sonar/api/checks/NoSonarFilter;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.picocontainer.injectors.AdaptingInjection$2.run(AdaptingInjection.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at org.picocontainer.injectors.AdaptingInjection.injectionFieldAnnotated(AdaptingInjection.java:209)
at org.picocontainer.injectors.AdaptingInjection.fieldAnnotatedInjectionAdapter(AdaptingInjection.java:188)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:57)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:239)
... 63 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.checks.NoSonarFilter
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 77 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/MojoExecutionException
The listed compatibility for the version 3.5 of the Java plugin ends at 5.1. There have been API changes in the 5.x series, so this can probably be solved with an upgrade of the Java plugin.
I'm using Eclipse Mars (4.5) with Maven 3.3.3.
Recently, I did a Maven update on a project Java 8 (SE), and all of the sudden, Eclipse didn't want the <packaging>jar</packaging> in my pom.xml to be valid, but wanted me to change the packaging to pom. Why can't I leave it to jar ?
Moreover, in the overview, the packaging choice is disabled.
When running maven from console (with jar packaging), this is what I get:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist #
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. # line 8, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist #
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. # line 8, column 13
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] The project MyProject:model:0.2 (C:\Users\Me\workspace\MyProject\pom.xml) has 2 errors
[ERROR] Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. # line 8, column 13
Can somebody help me ? at least in re-enabling jar packaging.
Thanks.
EDIT: Indeed, somehow my pom.xml had some new lines added (I don't know why or how):
<modules>
<module>?</module>
</modules>
That was what caused the issue. Removing it made the problem go away, thank you !
Because if your pom declares modules it is an "aggregator POM" - aggregator modules must be pom. That is why you get the following error in your log:
[ERROR] 'packaging' with value 'jar' is invalid.
Aggregator projects require 'pom' as packaging. # line 8, column 13
You can go back to jar when you remove all the <module> declarations from your pom.
Please refer to the documentation of multi-module projects.
Somehow after restarting Eclipse an additional "module" with a "?" got added to my pom file. Search for this and remove it. It will resolve the issue.
<module>?</module>
I'm trying to use the jpa-ddl-maven-plugin as described here but I'm getting a the below error using Apache Maven 3.0.3. Any ideas where I've gone wrong?
my pom.xml:
<plugin>
<groupId>it.linksmt.tooling</groupId>
<artifactId>maven-jpa-ddl-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<targetDbPlatform>OraclePlatform</targetDbPlatform>
<persistenceUnitName>test-entity-api</persistenceUnitName>
<persistenceUnitFile>META-INF/persistence.xml</persistenceUnitFile>
</configuration>
</plugin>
settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>it.linksmt.tooling</pluginGroup>
</pluginGroups>
</settings>
Error:
WARNING] The POM for it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.test.sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
[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/PluginResolutionException
mvn clean install -e output:
ERROR]
[ERROR] The project com.test:sample:sample-api:1.0.0-SNAPSHOT (/project/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT -> [Help 2]
org.apache.maven.plugin.PluginResolutionException: Plugin it.linksmt.tooling:maven-jpa-ddl-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:215)
at org.apache.maven.project.DefaultProjectBuildingHelper.resolveExtensionArtifacts(DefaultProjectBuildingHelper.java:377)
at org.apache.maven.project.DefaultProjectBuildingHelper.createProjectRealm(DefaultProjectBuildingHelper.java:237)
at org.apache.maven.project.DefaultModelBuildingListener.buildExtensionsAssembled(DefaultModelBuildingListener.java:106)
at org.apache.maven.model.building.ModelBuildingEventCatapult$1.fire(ModelBuildingEventCatapult.java:43)
at org.apache.maven.model.building.DefaultModelBuilder.fireEvent(DefaultModelBuilder.java:1041)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:391)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:374)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:536)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:542)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:328)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:581)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:233)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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 it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:541)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:395)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:207)
... 26 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact it.linksmt.tooling:maven-jpa-ddl-plugin:jar:1.0.0-SNAPSHOT
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:531)
... 29 more
You are trying to use a SNAPSHOT version of the plugin, which will not be found in Maven's default repository - Maven Central.
Looking at the plugin Google code page, it seems that it is currently in beta and has no release version.
You have a couple of options for resolving this plugin:
build it from the source as described here and install it to your local Maven repository. This will be useful only on your machine.
build the plugin and deploy it to a repository manager such as Artifactory. This will help you sharing the plugin with other team members/CI server.
Resolve the plugin from this repository. Notice, I found it by searching Google, but have no idea who is managing it. You will have to define a new repository for this.