I am new to maven, while using mvn install I've got this error, any idea?
thanks in advance
java.lang.IllegalArgumentException: Invalid uri 'http://maven.mysite.com:9999/repository/npg/data-recovery/${applicationVersion}/data-recovery-${applicationVersion}.pom': escaped absolute path not valid
at hidden.org.apache.commons.httpclient.HttpMethodBase.(HttpMethodBase.java:222)
at hidden.org.apache.commons.httpclient.methods.GetMethod.(GetMethod.java:89)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:547)
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.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:491)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:372)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:327)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:255)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedProject(MavenMetadataSource.java:163)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieveRelocatedArtifact(MavenMetadataSource.java:94)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:388)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:74)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:316)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:304)
at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1492)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:435)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Mar 04 15:12:56 EET 2010
[INFO] Final Memory: 19M/35M
You are using <version>${applicationVersion}</version> somewhere (maybe in this POM or maybe in a parent POM if the version is inherited) but this property is not resolved. You need to define something like this:
<project>
<properties>
<applicationVersion>x.y.z</applicationVersion>
</properties>
...
</project>
Note that I don't really see the point of using such a property, there is a built in ${project.version} property that refers to the version of the project (that you can use in dependencies for example). Check the MavenPropertiesGuide for more details on available properties.
The property ${applicationVersion} is not resolved in the URI path shown:
'http://maven.mysite.com:9999/repository/npg/data-recovery/${applicationVersion}/data-recovery-${applicationVersion}.pom'
I guess this is a dependency configured in your pom. You should locate "data-recovery" among the dependencies in your pom.xml - my bet is that its <version> property is set to ${applicationVersion}. If so, you should set the concrete version for it.
I have the same issue while using a property to set parent pom version in my child module.
You can use maven release plugin to achieve this. Just update version in your parent pom file and run this command to update version in your child module from parent folder:
mvn -N versions:update-child-modules
Related
I'm developing a software with jackson, but totally get stuck... When I run the spring-boot program with java -jar <MY_APPLICATION>.jar command, I got the following error:
...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.fasterxml.jackson.databind.ObjectMapper]: Factory method 'jacksonObjectMapper' threw exception; nested exception is
java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;)V from class com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 84 more
Caused by: java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;)V from class com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
at com.fasterxml.jackson.datatype.jsr310.JavaTimeModule.<init>(JavaTimeModule.java:159)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:78)
at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.registerWellKnownModulesIfAvailable(Jackson2ObjectMapperBuilder.java:719)
at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.configure(Jackson2ObjectMapperBuilder.java:572)
at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:554)
at org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration.jacksonObjectMapper(JacksonAutoConfiguration.java:87)
at org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration$$EnhancerBySpringCGLIB$$2434a0bb.CGLIB$jacksonObjectMapper$0(<generated>)
at org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration$$EnhancerBySpringCGLIB$$2434a0bb$$FastClassBySpringCGLIB$$d685921f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration$$EnhancerBySpringCGLIB$$2434a0bb.jacksonObjectMapper(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 85 more
There are more error messages above the error, but I think the important message is java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;), which I know it cannot happen generally.
I confirmed that the jackson modules are in the same version(2.6.5 which comes from spring-boot's dependency), and codehaus's jackson is not included:
$ mvn dependency:tree -Dverbose -Dincluces=com.fasterxml.jackson.core | grep -v omitted
...
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # patriot-fdc-web ---
[INFO] <MY_GROUP>:<MY_APPLICATION_A>:war:0.3.9-SNAPSHOT
[INFO] +- <MY_GROUP>:<MY_APPLICATION_B>:jar:0.3.9-SNAPSHOT:compile
[INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.6.5:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.6.5:compile
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:1.3.3.RELEASE:compile
[INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.6.5:compile (version managed from 2.4.2)
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.5:compile (version managed from 2.6.0)
Can anybody encounter such a problem? Anyone can suggest any solution or possibility for the error? Thank you in advance.
I've found the cause.
The dependency included calcite-avartica artifact, and it has a shaded jackson in it with version 2.1.1. That's why I cannot find the dependency by mvn dependency:tree. I found it through debugging remotely by seeing where StdSerializer came from.
https://issues.apache.org/jira/browse/CALCITE-1110
Avartica 1.9.0 or later might not bother us. I just excluded calcite-core and calcite-avartica and finally it worked fine.
Had a similar issue in sbt, the fix was also to remove calcita-core and calcite-avatica like so
ExclusionRule(organization = "org.apache.calcite", name = "calcite-core"),
ExclusionRule(organization = "org.apache.calcite", name = "calcite-avatica")
I also had a similar issue, and it was due to transitive dependency of jackson-datatype-jsr310 with lower version coming along with jackson-databind. Got the issue resolved by adding the exclude statement from the first level dependency in build.gradle.
compile (<dependency>){
exclude group: "com.fasterxml.jackson.datatype", module: "jackson-datatype-jsr310"
}
In case if you are using Maven, just identify which dependency is adding this dependency of Jackson with jsr310. To do this,
Open pom in Eclispe and select tab dependency hierarchy and search jsr310
Identify the name of dependency by which it is being added
Add below exclusion into pom.xml
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
</exclusions>
At the path C:\PMX\checkout\components\promomax-all_webapps_component I have this this file: pom-aggregator-packaging.xml
The file pom-aggregator-packaging.xml contains some modules checked out with turtoiseCVS.
When I go in cmd to the path C:\PMX\checkout\components\promomax-all_webapps_component and type mvn -f pom-aggregator-packaging.xml clean install the returned error is:
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file 'C:\PMX\checkout\bundles\promomax-spring_aspects'. for project unknown
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the model file 'C:\PMX\checkout\bundles\promomax-spring_aspects'. for project unknown
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: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.project.ProjectBuildingException: Could not find the model file 'C:\PMX\checkout\bundles\promomax-spring_aspects'. for project unknown
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1575)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
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.collectProjects(DefaultMaven.java:560)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:391)
... 12 more
Caused by: java.io.FileNotFoundException: C:\PMX\checkout\bundles\promomax-spring_aspects (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:124)
at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:67)
at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:118)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1570)
... 18 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Fri Oct 02 15:46:09 EEST 2015
[INFO] Final Memory: 6M/243M
[INFO] ------------------------------------------------------------------------
The content of pom-aggregator-packaging.xml is:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.company_name.app_name</groupId>
<artifactId>monitoring-pom-aggregator</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>NameOfTheApp Engine Server Component Pom Aggregator</name>
<modules>
...
<module>../../bundles/promomax-spring_aspects</module>
...
</modules>
</project>
Could you, please, help me to fix this error?
If in pom-aggregator-packaging.xml I change the
<module>../../bundles/promomax-spring_aspects</module> giving the absolute path:
<module>C:/PMX/checkout/components/promomax-all_webapps_component/bundles/promomax-spring_aspects</module>
and then again I run the command mvn -f pom-aggregator-packaging.xml clean install, the new error is:
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to canonicalize file name C:\PMX\checkout\components\promomax-all_webapps_component\C:\PMX\checkout\components\promomax-all_webapps_component\bundles\promomax-spring_aspects
The filename, directory name, or volume label syntax is incorrect
[INFO] ------------------------------------------------------------------------
Pretty sure that if you replace
<module>../../bundles/promomax-spring_aspects</module>
with
<module>../../components/promomax-all_webapps_component/bundles/promomax-spring_aspects</module>
it will work.
But your setup does not seem clean at all to me. Referring to modules is usually done from a parent POM which should reside on a higher level (file system) than the child poms.
So rather something like
myproject
my module1
pom.xml
my module2
pom.xml
pom.xml (parent)
You should not depend on relative paths unless you're in a parent/child context.
Further reading:
https://stackoverflow.com/a/10453063/190596
I'm trying to make a web script in groovy and run that web script on Alfresco. But, i don't know how to. I read tutorials but I haven't come to any conclusion...
Anyone knows all steps to run a web script in groovy ? Which files I need?
My idea is to make a integration of one application groovy on Alfresco.
For example, i'm trying to test one of this web scripts: https://github.com/pmonks/alfresco-groovy-webscripts
But i got the error :
$ mvn clean package
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/alfresco/extension/alfresco-groovy-webscripts-parent/1.3/alfresco-groovy-webscripts-parent-1.3.pom
[INFO] Unable to find resource 'org.alfresco.extension:alfresco-groovy-webscripts-parent:pom:1.3' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: null:alfresco-groovy-webscripts-webscripts:amp:null
Reason: Cannot find parent: org.alfresco.extension:alfresco-groovy-webscripts-parent for project: null:alfresco-groovy-webscripts-webscripts:amp:null for project null:alfresco-groovy-webscripts-webscripts:amp:null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: org.alfresco.extension:alfresco-groovy-webscripts-parent for project: null:alfresco-groovy-webscripts-webscripts:amp:null for project null:alfresco-groovy-webscripts-webscripts:amp:null
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: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.project.ProjectBuildingException: Cannot find parent: org.alfresco.extension:alfresco-groovy-webscripts-parent for project: null:alfresco-groovy-webscripts-webscripts:amp:null for project null:alfresco-groovy-webscripts-webscripts:amp:null
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1396)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:823)
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
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.alfresco.extension:alfresco-groovy-webscripts-parent' not found in repository: Unable to download the artifact from any repository
org.alfresco.extension:alfresco-groovy-webscripts-parent:pom:1.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
for project org.alfresco.extension:alfresco-groovy-webscripts-parent
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:605)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1392)
... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
org.alfresco.extension:alfresco-groovy-webscripts-parent:pom:1.3
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:228)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:90)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:558)
... 19 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:404)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:216)
... 21 more
I try too the web scripts already in Alfresco examples, but i got error, for example:
The Web Script /alfresco/s/default/surfbug has responded with a status of 500 - Internal Error.
This looks like strictly a maven problem to me. The exception states that Unable to download the artifact from any repository. This means that you've got a dependency on something that can't be found in either your local repository or any of the default or configured remote repository.
The missing dependency is stated as org.alfresco.extension:alfresco-groovy-webscripts-parent:pom:1.3. To get this to work, this artifact needs to be in your local repository. I couldn't find any reference to this in the common remote repositories, so it might be something you need to build from source.
The link you provided in your question is for a github project with the following code in its pom.xml file:
<groupId>org.alfresco.extension</groupId>
<artifactId>alfresco-groovy-webscripts-parent</artifactId>
<packaging>pom</packaging>
<version>1.4-SNAPSHOT</version>
Notice that the groupId and artifactId match your missing dependency, but the version is different. If you've installed this sample, using mvn install, then version 1.4-SNAPSHOT of this dependency should already be in your local repository. You could search your pom files for the dependency on alfresco-groovy-webscripts-parent v1.3, and change it to 1.4-SNAPSHOT and try again.
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>
If I type the command:
mvn dependency:list
The docs suggest that I'll get a list of my project's dependencies. Instead though, I get this:
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] -----------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] -----------------------------------------------------------
[INFO] Required goal not found: dependency:list
Call me a hopeful naive, but I had hoped maven would download any plugins it didn't have. Does anyone know what might be leading to this error? Does anyone know where maven stores information about what plugins it has installed, and where they're stored in the maven repository?
Have you tried mvn -cpu dependency:list (or: mvn --check-plugin-updates dependency:list)? Probably, you have older version of dependency plugin which does not have goal list
If this does not help, try upgrading Maven. Since 2.0.9 default versions are provided by the Super POM for most important plugins (dependency plug-in included), so 2.0 version will be downloaded (which has list goal).
Or you can try removing the cached version of the plug-in from the repository (~/.m2/repository/org/apache/maven/plugins/maven-dependency-plugin/, where ~ is the user home directory).
I have gotten a similiar result from being behind the corporate firewall. Proxy settings in your config (settings.xml) might be the answer.
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<username>user</username>
<password>passwrd</password>
<protocol>http</protocol>
<host>example.proxy.name.com</host>
<port>80</port>
</proxy>
</proxies>
To answer my own question, thanks to some comments that were made on it, the settings.xml file had been customized and did not list the central maven repository.
Oops.
Many Maven troubles can be solved easier by knowing all the details of the failed attempt when posting to forums (answering many of the follow-up questions folks above posted) or mailing list, and this is accomplished by running Maven with the debug and exception option switches like so: mvn <yourgoal> -X -e
Sample output then will look like this:
[~/Documents/Temp/Scratch] mvn clean -e -X
Using Java version: 1.6
+ Error stacktraces are turned on.
Maven version: 2.0.9
Java version: 1.6.0_07
OS name: "mac os x" version: "10.5.6" arch: "x86_64" Family: "mac"
[DEBUG] Building Maven user-level plugin registry from: '/Users/mccm06/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: '/Applications/Dev/apache-maven/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::10 for project: null:maven-clean-plugin:maven-plugin:2.2 from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::7 for project: org.apache.maven.plugins:maven-plugins:pom:10 from the repository.
[DEBUG] Retrieving parent-POM: org.apache:apache::4 for project: org.apache.maven:maven-parent:pom:7 from the repository.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:377)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon Feb 16 10:59:39 MST 2009
[INFO] Final Memory: 2M/7M
[INFO] ------------------------------------------------------------------------
Try latest maven version, usually upgrades to newer versions solve issues.
While unrelated to your issue being fixed, first you should execute install and only then try executing goals for your plugin.