I see I've misinterpreted the concept from the maven guide. Thanks for clearing up my misunderstanding! :)
Best regards Kiren On Fri, Sep 30, 2011 at 1:53 PM, Guillaume Polet <[email protected]> wrote: > Hi, > > So I have briefly read your pom.xml and it seems that you have put the > dependency for spring in the dependencyMgmt element and not in the > dependencies element. So let me straight things out here: > * dependencyMgmt are used to declare version number, configuration, scope, > etc... but it does not mean that you depend on them, you just inform Maven > of the default values to use, if they are not defined in the dependencies > element. > * dependencies are used to declare on which artifacts your project(s) > depend. If you do not define version, scope, etc..., Maven will try to pick > them up from the dependencyMgmt. > > A best practice is to define in your super pom, the version of all your > dependencies of all your project in the dependencyMgmt and then simply > "instantiate" those dependency in each child project. This allows you to > centralize all the versions of all jars used in all projects. > > So in your super pom you define: > <dependencyMgmt> > <dependency> > <groupId>x.y.z</groupId> > <artifactId>azerty</artifactId> > <version>1.2.3</version> > </dependency> > ... > </dependencyMgmt> > > Then in your child pom you can simply put: > <dependencies> > <dependency> > <groupId>x.y.z</groupId> > <artifactId>azerty</artifactId> > </dependency> > ... > </dependencies> > without the version number, and Maven will automatically find that you want > version 1.2.3. Yet, you can still "override" this default value by setting > the version number in the child pom. > > In the dependency > > Le 30/09/2011 11:02, Kiren Pillay a écrit : >> >> Hi >> >> I think our project is misconfigured. From reading the docs again, the >> common dependencies go to within the dependencyManagent tag (we where >> using the dependencies before). >> >> I've fixed this but still see that the dependencies declared in the >> super pom aren't being picked up by the children. >> >> For instance the springframeork annotation package isn't being picked >> up even though its in the super pom. >> >> [ERROR] >> /home/kiren/Documents/workspace-subsnp/pams-main/core/advantage/src/main/java/za/co/vodacom/pams/core/in/dao/INSubscriberProfileDaoImpl.java:[4,51] >> package org.springframework.beans.factory.annotation does not exist >> >> Child: >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <project xmlns="http://maven.apache.org/POM/4.0.0" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> >> <modelVersion>4.0.0</modelVersion> >> >> <parent> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-core</artifactId> >> <version>1.2.1-DEV-SNAPSHOT</version> >> </parent> >> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-advantage</artifactId> >> <version>1.2.1-DEV-SNAPSHOT</version> >> <name>PAMS Core - IN DAO</name> >> <packaging>jar</packaging> >> >> <dependencies> >> >> <!-- IN Advantage CORBA Interface --> >> <dependency> >> <groupId>za.co.vodacom.advantage</groupId> >> <artifactId>advantage-corba-interface</artifactId> >> </dependency> >> >> <dependency> >> <groupId>za.co.vodacom.fap</groupId> >> <artifactId>fap-core</artifactId> >> <version>${fcaps.version}</version> >> <type>jar</type> >> <scope>compile</scope> >> </dependency> >> >> >> </dependencies> >> >> <build> >> <plugins> >> <plugin> >> <artifactId>maven-compiler-plugin</artifactId> >> <configuration> >> <source>${java.source.version}</source> >> <target>${java.target.version}</target> >> <showDeprecation>true</showDeprecation> >> </configuration> >> </plugin> >> <plugin> >> <artifactId>maven-surefire-plugin</artifactId> >> <configuration> >> <forkMode>never</forkMode> >> </configuration> >> </plugin> >> </plugins> >> </build> >> >> </project> >> >> >> >> >> Parent: >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <project xmlns="http://maven.apache.org/POM/4.0.0" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> >> <modelVersion>4.0.0</modelVersion> >> >> <parent> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-main</artifactId> >> <version>1.2.1-DEV-SNAPSHOT</version> >> </parent> >> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-core</artifactId> >> <name>PAMS Core</name> >> <packaging>pom</packaging> >> <version>1.2.1-DEV-SNAPSHOT</version> >> >> <modules> >> <!-- common used project need to be before other, chicken and egg--> >> <module>common</module> >> <module>pams-schema</module> >> <module>advantage</module> >> <module>ppfe-connectors</module> >> <module>ppfe_dao</module> >> <module>pams-rms-dao</module> >> <module>pams-pams-dao</module> >> <!--<module>audit</module> --> >> <module>pams-cur-dao</module> >> </modules> >> >> </project> >> >> Super ("Grandparent") >> >> <?xml version="1.0" encoding="UTF-8"?> >> >> <project xmlns="http://maven.apache.org/POM/4.0.0" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 >> http://maven.apache.org/xsd/maven-4.0.0.xsd"> >> >> <modelVersion>4.0.0</modelVersion> >> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-main</artifactId> >> <version>1.2.1-DEV-SNAPSHOT</version> >> <packaging>pom</packaging> >> <name>PAMS - Main</name> >> >> <modules> >> <module>core</module> >> <module>business_services</module> >> </modules> >> >> <properties> >> <pams.version>1.2.1-DEV-SNAPSHOT</pams.version> >> <fcaps.version>1.1.0</fcaps.version> >> <spring.version>3.0.5.RELEASE</spring.version> >> <slf4j.version>1.6.1</slf4j.version> >> >> <log4j.version>1.2.16</log4j.version> >> <junit.version>4.8.1</junit.version> >> <java.source.version>1.6</java.source.version> >> <java.target.version>1.6</java.target.version> >> >> <cxf.version>2.4.2</cxf.version> >> <httpclient.version>3.1</httpclient.version> >> <jsr311.version>1.1.1</jsr311.version> >> <xmlBeans.version>2.5.0</xmlBeans.version> >> <tandem.jdbc.version>8.9.26</tandem.jdbc.version> >> <hibernate.version>3.3.2.GA</hibernate.version> >> <slf4j.version>1.6.1</slf4j.version> >> <slf4j.log4j.version>slf4j-log4j12</slf4j.log4j.version> >> <jtds.jdbc.version>1.2.2</jtds.jdbc.version> >> <asn1.version>5.64</asn1.version> >> >> </properties> >> <build> >> <!-- Maven test JAR plugin, DONT remove --> >> <plugins> >> >> <plugin> >> <artifactId>maven-jar-plugin</artifactId> >> <version>2.3.1</version> >> <executions> >> <execution> >> <goals> >> <goal>test-jar</goal> >> </goals> >> <phase>test-compile</phase> >> </execution> >> >> </executions> >> <!--<configuration> >> >> <outputDirectory>${basedir}\target</outputDirectory> >> </configuration> >> --> >> </plugin> >> >> </plugins> >> </build> >> >> <!-- Spring --> >> <dependencies> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-test</artifactId> >> <version>${spring.version}</version> >> </dependency> >> </dependencies> >> <!-- >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-core</artifactId> >> <version>${spring.version}</version> >> </dependency> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-beans</artifactId> >> <version>${spring.version}</version> >> </dependency> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-context</artifactId> >> <version>${spring.version}</version> >> </dependency> >> >> --> >> >> <dependencyManagement> >> >> <dependencies> >> >> <dependency> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-core-xsd-server</artifactId> >> <version>${pams.version}</version> >> <type>jar</type> >> <scope>compile</scope> >> </dependency> >> <!-- SLF --> >> <dependency> >> <groupId>org.slf4j</groupId> >> <artifactId>slf4j-api</artifactId> >> <version>${slf4j.version}</version> >> <type>jar</type> >> </dependency> >> >> <dependency> >> <groupId>org.slf4j</groupId> >> <artifactId>jcl-over-slf4j</artifactId> >> <version>${slf4j.version}</version> >> <type>jar</type> >> </dependency> >> >> <dependency> >> <groupId>org.slf4j</groupId> >> <artifactId>${slf4j.log4j.version}</artifactId> >> <version>${slf4j.version}</version> >> <type>jar</type> >> </dependency> >> >> <!-- Tandem JDBC Driver --> >> <dependency> >> <groupId>com.tandem.t4jdbc</groupId> >> <artifactId>t4sqlmx</artifactId> >> <version>${tandem.jdbc.version}</version> >> <type>jar</type> >> <exclusions> >> <exclusion> >> <groupId>commons-logging</groupId> >> <artifactId>commons-logging</artifactId> >> </exclusion> >> </exclusions> >> </dependency> >> >> <!-- Hibernate --> >> >> <dependency> >> <groupId>org.hibernate</groupId> >> <artifactId>hibernate-core</artifactId> >> <version>${hibernate.version}</version> >> <type>jar</type> >> <exclusions> >> <exclusion> >> <groupId>commons-logging</groupId> >> <artifactId>commons-logging</artifactId> >> </exclusion> >> </exclusions> >> </dependency> >> <dependency> >> <groupId>org.hibernate</groupId> >> <artifactId>hibernate-entitymanager</artifactId> >> <version>${hibernate.version}</version> >> <type>jar</type> >> <exclusions> >> <exclusion> >> <groupId>cglib</groupId> >> <artifactId>cglib</artifactId> >> </exclusion> >> <exclusion> >> <groupId>dom4j</groupId> >> <artifactId>dom4j</artifactId> >> </exclusion> >> </exclusions> >> </dependency> >> >> >> >> <!-- 3rd Party --> >> <!-- Log4J --> >> <dependency> >> <groupId>log4j</groupId> >> <artifactId>log4j</artifactId> >> <version>${log4j.version}</version> >> <type>jar</type> >> </dependency> >> >> <!-- JUnit --> >> <dependency> >> <groupId>junit</groupId> >> <artifactId>junit</artifactId> >> <version>${junit.version}</version> >> <type>jar</type> >> <scope>test</scope> >> </dependency> >> >> <!-- Spring --> >> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-test</artifactId> >> <version>${spring.version}</version> >> <type>jar</type> >> </dependency> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-core</artifactId> >> <version>${spring.version}</version> >> <type>jar</type> >> </dependency> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-beans</artifactId> >> <version>${spring.version}</version> >> <type>jar</type> >> </dependency> >> >> <dependency> >> <groupId>org.springframework</groupId> >> <artifactId>spring-context</artifactId> >> <version>${spring.version}</version> >> <type>jar</type> >> </dependency> >> >> >> >> >> >> <!-- FCAPS --> >> >> <dependency> >> <groupId>za.co.vodacom.fap</groupId> >> <artifactId>fap-core</artifactId> >> <version>${fcaps.version}</version> >> <type>jar</type> >> <scope>compile</scope> >> </dependency> >> <!-- Hibernate --> >> <dependency> >> <groupId>org.hibernate</groupId> >> <artifactId>hibernate-core</artifactId> >> <version>${hibernate.version}</version> >> <type>jar</type> >> <exclusions> >> <exclusion> >> <groupId>commons-logging</groupId> >> <artifactId>commons-logging</artifactId> >> </exclusion> >> </exclusions> >> </dependency> >> >> <dependency> >> <groupId>org.hibernate</groupId> >> <artifactId>hibernate-entitymanager</artifactId> >> <version>${hibernate.version}</version> >> <type>jar</type> >> <exclusions> >> <exclusion> >> <groupId>commons-logging</groupId> >> <artifactId>commons-logging</artifactId> >> </exclusion> >> <exclusion> >> <groupId>cglib</groupId> >> <artifactId>cglib</artifactId> >> </exclusion> >> <exclusion> >> <groupId>dom4j</groupId> >> <artifactId>dom4j</artifactId> >> </exclusion> >> </exclusions> >> </dependency> >> >> <!-- IN Advantage Corba Interface --> >> <dependency> >> <groupId>za.co.vodacom.advantage</groupId> >> <artifactId>advantage-corba-interface</artifactId> >> <version>1.1.0</version> >> <type>jar</type> >> </dependency> >> >> <!-- Vodacom Apache Pool Wrapper --> >> <dependency> >> <groupId>za.co.vodacom.commons</groupId> >> <artifactId>poolmanager</artifactId> >> <version>1.0.0_minpoolsize-SNAPSHOT</version> >> <type>jar</type> >> </dependency> >> >> <!-- ASN1 --> >> <dependency> >> <groupId>com.objsys.asn1j</groupId> >> <artifactId>asn1rt</artifactId> >> <version>${asn1.version}</version> >> <type>jar</type> >> </dependency> >> <dependency> >> <groupId>za.co.vodacom.pams</groupId> >> <artifactId>pams-pams-dao</artifactId> >> <version>${pams.version}</version> >> <type>jar</type> >> <scope>compile</scope> >> </dependency> >> </dependencies> >> >> </dependencyManagement> >> >> <distributionManagement> >> <repository> >> <id>vodacom-releases-local</id> >> <name>vodacom-releases-local</name> >> <url>http://bcx-repo/artifactory/vodacom-releases-local</url> >> </repository> >> <snapshotRepository> >> <id>vodacom-snapshots-local</id> >> <name>vodacom-snapshots-local</name> >> <url>http://bcx-repo/artifactory/vodacom-snapshots-local</url> >> </snapshotRepository> >> </distributionManagement> >> >> <ciManagement> >> <system>continuum</system> >> <url>http://bcx-repo/continuum</url> >> </ciManagement> >> >> <scm> >> >> <connection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/</connection> >> >> <developerConnection>scm:svn:http://bcx-svn/svn/vodacom.za/pams/server/</developerConnection> >> <url>http://bcx-svn/viewvc/pams/server/?root=svn</url> >> </scm> >> >> >> >> <reporting> >> <plugins> >> <!-- Plugins used for Hudson --> >> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-checkstyle-plugin</artifactId> >> <version>2.2</version> >> >> </plugin> >> <!-- this is to solve the Hudson Memory issues --> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-surefire-plugin</artifactId> >> <version>2.7.1</version> >> <configuration> >> <excludes> >> <exclude>**/Abstract*.java</exclude> >> <exclude>**/TestPAMSInfoService.java</exclude> >> >> <exclude>**/TestAirtimeTransferRegistrationQuery.java</exclude> >> <exclude>**/TetsRest.java</exclude> >> <exclude>**/TestQuerySubscriberINProfile.java</exclude> >> </excludes> >> >> >> <forkMode>pertest</forkMode> >> <argLine>-Xmx512m -XX:MaxPermSize=512m</argLine> >> >> </configuration> >> </plugin> >> >> >> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-project-info-reports-plugin</artifactId> >> <version>2.0.1</version> >> </plugin> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>jdepend-maven-plugin</artifactId> >> </plugin> >> <plugin> >> <artifactId>maven-pmd-plugin</artifactId> >> <configuration> >> <sourceEncoding>utf-8</sourceEncoding> >> <minimumTokens>10</minimumTokens> >> <includeTests>false</includeTests> >> <targetJdk>1.6</targetJdk> >> <targetJdk>${maven.compiler.target}</targetJdk> >> </configuration> >> </plugin> >> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>findbugs-maven-plugin</artifactId> >> <version>2.3.1</version> >> <configuration> >> <xmlOutput>true</xmlOutput> >> <findbugsXmlOutput>true</findbugsXmlOutput> >> >> <findbugsXmlWithMessages>true</findbugsXmlWithMessages> >> <threshold>Default</threshold> >> >> <debug>false</debug> >> <relaxed>false</relaxed> >> <maxHeap>1024</maxHeap> >> </configuration> >> </plugin> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>taglist-maven-plugin</artifactId> >> <configuration> >> <tags> >> <tag>TODO</tag> >> <tag>FIXME</tag> >> <tag>@todo</tag> >> <tag>@deprecated</tag> >> </tags> >> </configuration> >> </plugin> >> <plugin> >> <groupId>org.codehaus.mojo</groupId> >> <artifactId>cobertura-maven-plugin</artifactId> >> <configuration> >> <formats> >> <format>xml</format> >> </formats> >> </configuration> >> </plugin> >> </plugins> >> </reporting> >> >> </project> >> >> >> >> On Thu, Sep 29, 2011 at 4:30 PM, Kiren Pillay<[email protected]> >> wrote: >>> >>> Thanks. Will try it again. >>> Regards >>> >>> On Sep 29, 2011 2:02 PM, "Guillaume Polet"<[email protected]> >>> wrote: >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
