0 Replies Latest reply on Apr 4, 2012 5:08 AM by lucabuster

    Maven migration from 4.0.0.Final to 4.2.0.Final

    lucabuster Newbie

      Hello all,

       

      we have a project on Eclipse 3.6.2 based environment, with m2e Maven plugin 1.0.100.20110804-1717, which uses Richfaces 4.0.0.Final. Eclipse project was created using archetipe coming along with 4.0.0.Final release. We recently decided to upgrade RF version from 4.0.0.Final to 4.2.0.Final, modifying our pom.xml from:

       

       

      <org.richfaces.bom.version>4.0.0.Final</org.richfaces.bom.version>
      

       

      to:

       

       

      <org.richfaces.bom.version>4.2.0.Final</org.richfaces.bom.version>
      

       

      this operation suddently caused errors in pom.xml which forced us to comment out following sections:

       

       

      <!-- <dependency>
           <groupId>javax.servlet</groupId>
           <artifactId>servlet-api</artifactId>
           <scope>provided</scope>
      </dependency> -->
      

       

      and:

       

       

      <!-- <dependency>
           <groupId>javax.servlet</groupId>
           <artifactId>jstl</artifactId>
      </dependency> -->
      
      

       

      At this point pom.xml does not complains about errors, but whole project is unable to compile:

       

      The container 'Maven Dependencies' references non existing library 'C:\Users\user\.m2\repository\org\richfaces\ui\richfaces-components-ui\4.2.0.Final\richfaces-components-ui-4.2.0.Final.jar'

       

      It seems unable to get proper libraries version.

       

      Is there a migration method we are not following? Is our approach wrong or is this a Maven specific issue in downloading libraries?

       

      Thanks in advance for any information.

       

      ############

       

      I enclose here original pom.xml for version 4.0.0.Final:

       

       

      <?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>com.crif.bac</groupId>
                <artifactId>BAC</artifactId>
                <name>Business Administration Console</name>
                <version>5.0.1</version>
                <packaging>war</packaging>
      
      
                <url>http://jboss.org/richfaces</url>
      
      
                <repositories>
                          <repository>
                                    <id>jboss-public-repository-group</id>
                                    <name>Jboss Repository for Maven</name>
                                    <url>https://repository.jboss.org/nexus/content/groups/public/</url>
                          </repository>
                          <repository>
                                    <id>java-net</id>
                                    <name>Java.net Maven Repository</name>
                                    <url>http://download.java.net/maven/2</url>
                          </repository>
                          <repository>
                                    <id>CFJ</id>
                                    <name>CreditFlow Java Repository</name>
                                    <url>http://cfjbuilder/maven</url>
                          </repository>
                </repositories>
      
      
                <properties>
                          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                          <!-- Setting this property using archetype-metadata.xml requiredPorperty 
                                    so that generated project uses correct version of richfaces. -->
                          <org.richfaces.bom.version>4.0.0.Final</org.richfaces.bom.version>
                </properties>
      
      
                <build>
                          <finalName>BAC-${project.version}</finalName>
                          <plugins>
                                    <plugin>
                                              <artifactId>maven-compiler-plugin</artifactId>
                                              <version>2.3.2</version>
                                              <configuration>
                                                        <source>1.6</source>
                                                        <target>1.6</target>
                                              </configuration>
                                    </plugin>
                                    <plugin>
                                              <artifactId>maven-war-plugin</artifactId>
                                              <version>2.1.1</version>
                                              <configuration>
                                                        <webResources>
                                                                  <resource>
                                                                            <directory>src/main/resources</directory>
                                                                            <includes>
                                                              <include>version.properties</include>
                                                           </includes>
                                                           <filtering>true</filtering>
                                                                            <targetPath>/WEB-INF</targetPath>
                                                                  </resource> 
                                                        </webResources> 
                                                        <warName>BAC</warName>
                                              </configuration>
                                    </plugin>
                  <plugin>
                                  <groupId>org.apache.maven.plugins</groupId>
                                  <artifactId>maven-surefire-plugin</artifactId>
                                  <version>2.8.1</version>
                                  <configuration>
                                            <test>BacTestSuite</test>
                                            <argLine>-Dbac.prop=src/test/resources/bac.properties -Dlogback.configurationFile=src/test/resources/logging/bac.logback.xml</argLine>
                                  </configuration>
                              </plugin>                       
                                       
                          </plugins>
                          <resources>
                                    <!-- "version.properties" is copied by war plugin because -->
                                    <!-- it must be copied into WEB-INF folder. -->
                                    <resource>
                                              <directory>src/main/resources</directory>
                                              <excludes>
                                                        <exclude>version.properties</exclude>
                                              </excludes>
                                    </resource> 
                          </resources>
                </build>
      
      
      
      
      
      
                <dependencyManagement>
                          <dependencies>
                                    <dependency>
                                              <groupId>org.richfaces</groupId>
                                              <artifactId>richfaces-bom</artifactId>
                                              <version>${org.richfaces.bom.version}</version>
                                              <scope>import</scope>
                                              <type>pom</type>
                                    </dependency>
                          </dependencies>
                </dependencyManagement>
      
      
                <dependencies>
                          <dependency>
                                    <groupId>org.richfaces.ui</groupId>
                                    <artifactId>richfaces-components-ui</artifactId>
                          </dependency>
                          <dependency>
                                    <groupId>org.richfaces.core</groupId>
                                    <artifactId>richfaces-core-impl</artifactId>
                          </dependency>
                          <dependency>
                                    <groupId>com.sun.faces</groupId>
                                    <artifactId>jsf-api</artifactId>
                                    <version>2.1.1-b04</version>
                          </dependency>
      <!-- Commented because using the patched version in WEB-INF/lib --> 
      <!--                     <dependency> -->
      <!--                               <groupId>com.sun.faces</groupId> -->
      <!--                               <artifactId>jsf-impl</artifactId> -->
      <!--                               <version>2.1.1-b04</version> -->
      <!--                     </dependency> -->
                          <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>servlet-api</artifactId>
                                    <scope>provided</scope>
                          </dependency>
                          <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>jsp-api</artifactId>
                                    <version>2.0</version>
                                    <scope>provided</scope>
                          </dependency>
                          <dependency>
                                    <groupId>javax.el</groupId>
                                    <artifactId>el-api</artifactId>
                                    <version>2.2</version>
                          </dependency>
                          <dependency>
                                    <groupId>org.glassfish.web</groupId>
                                    <artifactId>el-impl</artifactId>
                                    <version>2.2</version>
                          </dependency>
                          <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>jstl</artifactId>
                          </dependency>
                          <dependency>
                                    <groupId>net.sf.ehcache</groupId>
                                    <artifactId>ehcache</artifactId>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-validator</artifactId>
                                    <version>4.1.0.Final</version>
                          </dependency>
        
                          <dependency>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                    <version>1.6.1</version>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-classic</artifactId>
                                    <version>0.9.28</version>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                    <version>0.9.3</version>
                                    <scope>provided</scope>
                          </dependency>
                          <dependency>
                                    <groupId>junit</groupId>
                                    <artifactId>junit</artifactId>
                                    <version>4.8.2</version>
                                    <scope>test</scope>
                          </dependency>
                          <dependency>
                                    <groupId>org.easymock</groupId>
                                    <artifactId>easymock</artifactId>
                                    <version>3.0</version>
                                    <scope>test</scope>
                          </dependency>
                          <dependency>
                                    <groupId>xmlunit</groupId>
                                    <artifactId>xmlunit</artifactId>
                                    <version>1.3</version>
                                    <scope>test</scope>
                          </dependency>
        
                          <dependency>
                                    <groupId>commons-codec</groupId>
                                    <artifactId>commons-codec</artifactId>
                                    <version>1.5</version>
                          </dependency>
        
                          <dependency>
                                    <groupId>commons-io</groupId>
                                    <artifactId>commons-io</artifactId>
                                    <version>2.0.1</version>
                          </dependency>
      
      
        
                          <dependency>
                                    <groupId>com.crif.deploy</groupId>
                                    <artifactId>wsdeployclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.enginefacade</groupId>
                                    <artifactId>wsfacadeclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.oru</groupId>
                                    <artifactId>wsoruclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.repository</groupId>
                                    <artifactId>wsrepositoryclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
      
      
                </dependencies>
      
      
                <distributionManagement>
                          <repository>
                                    <id>mycompany-repository</id>
                                    <name>MyCompany Repository</name>
                                    <url>file://\\cfjbuilder\c$\Inetpub\wwwroot\maven\</url>
                          </repository>
                </distributionManagement>
      </project>
      
      

       

       

      This is modified pom.xml for 4.2.0.Final:

       

      <?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>com.crif.bac</groupId>
                <artifactId>BAC</artifactId>
                <name>Business Administration Console</name>
                <version>5.0.1</version>
                <packaging>war</packaging>
      
      
                <url>http://jboss.org/richfaces</url>
      
      
                <repositories>
                          <repository>
                                    <id>jboss-public-repository-group</id>
                                    <name>Jboss Repository for Maven</name>
                                    <url>https://repository.jboss.org/nexus/content/groups/public/</url>
                          </repository>
                          <repository>
                                    <id>java-net</id>
                                    <name>Java.net Maven Repository</name>
                                    <url>http://download.java.net/maven/2</url>
                          </repository>
                          <repository>
                                    <id>CFJ</id>
                                    <name>CreditFlow Java Repository</name>
                                    <url>http://cfjbuilder/maven</url>
                          </repository>
                </repositories>
      
      
                <properties>
                          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                          <!-- Setting this property using archetype-metadata.xml requiredPorperty 
                                    so that generated project uses correct version of richfaces. -->
                          <org.richfaces.bom.version>4.2.0.Final</org.richfaces.bom.version>
                </properties>
      
      
                <build>
                          <finalName>BAC-${project.version}</finalName>
                          <plugins>
                                    <plugin>
                                              <artifactId>maven-compiler-plugin</artifactId>
                                              <version>2.3.2</version>
                                              <configuration>
                                                        <source>1.6</source>
                                                        <target>1.6</target>
                                              </configuration>
                                    </plugin>
                                    <plugin>
                                              <artifactId>maven-war-plugin</artifactId>
                                              <version>2.1.1</version>
                                              <configuration>
                                                        <webResources>
                                                                  <resource>
                                                                            <directory>src/main/resources</directory>
                                                                            <includes>
                                                              <include>version.properties</include>
                                                           </includes>
                                                           <filtering>true</filtering>
                                                                            <targetPath>/WEB-INF</targetPath>
                                                                  </resource> 
                                                        </webResources> 
                                                        <warName>BAC</warName>
                                              </configuration>
                                    </plugin>
                  <plugin>
                                  <groupId>org.apache.maven.plugins</groupId>
                                  <artifactId>maven-surefire-plugin</artifactId>
                                  <version>2.8.1</version>
                                  <configuration>
                                            <test>BacTestSuite</test>
                                            <argLine>-Dbac.prop=src/test/resources/bac.properties -Dlogback.configurationFile=src/test/resources/logging/bac.logback.xml</argLine>
                                  </configuration>
                              </plugin>                       
                                       
                          </plugins>
                          <resources>
                                    <!-- "version.properties" is copied by war plugin because -->
                                    <!-- it must be copied into WEB-INF folder. -->
                                    <resource>
                                              <directory>src/main/resources</directory>
                                              <excludes>
                                                        <exclude>version.properties</exclude>
                                              </excludes>
                                    </resource> 
                          </resources>
                </build>
      
      
      
      
      
      
                <dependencyManagement>
                          <dependencies>
                                    <dependency>
                                              <groupId>org.richfaces</groupId>
                                              <artifactId>richfaces-bom</artifactId>
                                              <version>${org.richfaces.bom.version}</version>
                                              <scope>import</scope>
                                              <type>pom</type>
                                    </dependency>
                          </dependencies>
                </dependencyManagement>
      
      
                <dependencies>
                          <dependency>
                                    <groupId>org.richfaces.ui</groupId>
                                    <artifactId>richfaces-components-ui</artifactId>
                          </dependency>
                          <dependency>
                                    <groupId>org.richfaces.core</groupId>
                                    <artifactId>richfaces-core-impl</artifactId>
                          </dependency>
                          <dependency>
                                    <groupId>com.sun.faces</groupId>
                                    <artifactId>jsf-api</artifactId>
                                    <version>2.1.1-b04</version>
                          </dependency>
      <!-- Commented because using the patched version in WEB-INF/lib --> 
      <!--                     <dependency> -->
      <!--                               <groupId>com.sun.faces</groupId> -->
      <!--                               <artifactId>jsf-impl</artifactId> -->
      <!--                               <version>2.1.1-b04</version> -->
      <!--                     </dependency> -->
                          <!-- <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>servlet-api</artifactId>
                                    <scope>provided</scope>
                          </dependency> -->
                          <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>jsp-api</artifactId>
                                    <version>2.0</version>
                                    <scope>provided</scope>
                          </dependency>
                          <dependency>
                                    <groupId>javax.el</groupId>
                                    <artifactId>el-api</artifactId>
                                    <version>2.2</version>
                          </dependency>
                          <dependency>
                                    <groupId>org.glassfish.web</groupId>
                                    <artifactId>el-impl</artifactId>
                                    <version>2.2</version>
                          </dependency>
                          <!-- <dependency>
                                    <groupId>javax.servlet</groupId>
                                    <artifactId>jstl</artifactId>
                          </dependency> -->
                          <dependency>
                                    <groupId>net.sf.ehcache</groupId>
                                    <artifactId>ehcache</artifactId>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-validator</artifactId>
                                    <version>4.1.0.Final</version>
                          </dependency>
        
                          <dependency>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                    <version>1.6.1</version>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-classic</artifactId>
                                    <version>0.9.28</version>
                          </dependency>
      
      
                          <dependency>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                    <version>0.9.3</version>
                                    <scope>provided</scope>
                          </dependency>
                          <dependency>
                                    <groupId>junit</groupId>
                                    <artifactId>junit</artifactId>
                                    <version>4.8.2</version>
                                    <scope>test</scope>
                          </dependency>
                          <dependency>
                                    <groupId>org.easymock</groupId>
                                    <artifactId>easymock</artifactId>
                                    <version>3.0</version>
                                    <scope>test</scope>
                          </dependency>
                          <dependency>
                                    <groupId>xmlunit</groupId>
                                    <artifactId>xmlunit</artifactId>
                                    <version>1.3</version>
                                    <scope>test</scope>
                          </dependency>
        
                          <dependency>
                                    <groupId>commons-codec</groupId>
                                    <artifactId>commons-codec</artifactId>
                                    <version>1.5</version>
                          </dependency>
        
                          <dependency>
                                    <groupId>commons-io</groupId>
                                    <artifactId>commons-io</artifactId>
                                    <version>2.0.1</version>
                          </dependency>
      
      
        
                          <dependency>
                                    <groupId>com.crif.deploy</groupId>
                                    <artifactId>wsdeployclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.enginefacade</groupId>
                                    <artifactId>wsfacadeclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.oru</groupId>
                                    <artifactId>wsoruclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
        
                          <dependency>
                                    <groupId>com.crif.repository</groupId>
                                    <artifactId>wsrepositoryclient</artifactId>
                                    <version>5.1.0-SNAPSHOT</version> 
                          </dependency>
      
      
                </dependencies>
      
      
                <distributionManagement>
                          <repository>
                                    <id>mycompany-repository</id>
                                    <name>MyCompany Repository</name>
                                    <url>file://\\cfjbuilder\c$\Inetpub\wwwroot\maven\</url>
                          </repository>
                </distributionManagement>
      </project>