maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Externalize POM file
Date Fri, 16 Dec 2011 08:36:28 GMT
You can't do like that. Please have a look here:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

/Anders

On Fri, Dec 16, 2011 at 08:37, KumarR <rupeshkumargupta@gmail.com> wrote:
> Thanks for the reply. Below is my POM script
>
> Parent Pom
> ---------------
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>  <parent>
>    <groupId>com.unisys.my-parent</groupId>
>    <artifactId>my-parent</artifactId>
>    <version>1.0</version>
>    <relativePath>../JarDefinition/pom.xml</relativePath>
>  </parent>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>com.unisys.SampleExample</groupId>
>  <artifactId>Sample</artifactId>
>  <packaging>jar</packaging>
>  <version>1.0-SNAPSHOT</version>
>  <name>Sample</name>
>  <dependencyManagement>
>  <dependencies>
>    <dependency>
>      <groupId>xyz</groupId>
>      <artifactId>junit</artifactId>
>          <version>${currentVersion}</version>
>    </dependency>
>  </dependencies>
>  </dependencyManagement>
> </project>
>
>
> Child POM
> ----------------
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>com.unisys.my-parent</groupId>
>  <artifactId>my-parent</artifactId>
>  <packaging>pom</packaging>
>  <version>1.0</version>
>
>  <dependencies>
>    <dependency>
>      <groupId>xyz</groupId>
>      <artifactId>junit</artifactId>
>
>          <properties><currentVersion>3.8.1</currentVersion></properties>
>    </dependency>
>        </dependencies>
> </project>
>
>
> I am getting below error
> ----------------------------
>
> Reason: Parse error reading POM. Reason: Unrecognised tag: 'properties'
> (position: START_TAG seen ...</version> -->\r\n\t  <properties>... @14:16)
> for project com.unisys.SampleExample:Sample at
> D:\Projects\LEIDA\LEIDA-Workspace\RnDWorkspace\JarDefinition\pom.xml
>
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.reactor.MavenExecutionException: Parse error reading POM.
> Reason: Unrecognised tag: 'properties' (position: START_TAG seen
> ...</version> -->\r\n\t  <properties>... @14:16)  for project
> com.unisys.SampleExample:Sample at
> D:\Projects\LEIDA\LEIDA-Workspace\RnDWorkspace\JarDefinition\pom.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:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:592)
>        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: Parse
> error reading POM. Reason: Unrecognised tag: 'properties' (position:
> START_TAG seen ...</version> -->\r\n\t  <properties>... @14:16)  for
project
> com.unisys.SampleExample:Sample at
> D:\Projects\LEIDA\LEIDA-Workspace\RnDWorkspace\JarDefinition\pom.xml
>        at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1610)
>        at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1571)
>        at
> org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1320)
>        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.codehaus.plexus.util.xml.pull.XmlPullParserException:
> Unrecognised tag: 'properties' (position: START_TAG seen ...</version>
> -->\r\n\t  <properties>... @14:16)
>        at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseDependency(MavenXpp3Reader.java:1225)
>        at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel(MavenXpp3Reader.java:2094)
>        at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.read(MavenXpp3Reader.java:3912)
>        at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1606)
>
> Regards
> Kumar
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Externalize-POM-file-tp5079337p5079564.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message