4 Replies Latest reply on Nov 28, 2012 8:54 AM by Darius Ski

    Richfaces build question: how to build a specific version with a patch

    Darius Ski Newbie

      Hello,

       

      I am new to git, and tried to read some tutorials, but I was not successful in my efforts to build custom version of specific RF build (for example 4.2.3.Final).

       

       

      Here is what i do according to a bit obsolete https://community.jboss.org/wiki/HowToBuildRichFaces4x:

       

       

      git clone git://github.com/richfaces/build.git

       

      cd build

       

      git reset e00b2cab19a344257e66cd0663f760fbea05f2de

      git reset --soft HEAD@{1}

      git commit -m "Revert to e00b2cab19a344257e66cd0663f760fbea05f2de"

      git reset --hard

      git clean -f -d

       

      so now it's at 4.2.3.Final (hopefully)

       

      so i proceed with:

       

      cd ..

       

      bash build/scripts/richgit.sh -t git -b remotes/origin/release/4.2.3.Final

       

      cd build

       

      mvn clean install -DskipTests=true -Dcheckstyle.skip=true -P build,release

       

      The result is 4.2.3.Final jars that match what is on web. Now is the part where I need help, I want to apply a patch to this version, so i go on to modify that file and tried the following:

       

      1) Just building - no go, jars remain same

      2) git commit -a followed by build. Still no luck, jars remain the same

       

      What sort of git or Richfaces kung-fu I am missing? Thanks in advance for bearing with git newbie.

       

      Darius.

        • 1. Re: Richfaces build question: how to build a specific version with a patch
          Pavol Pitonak Master

          Hi,

           

          after you make a change in RichFaces code, you just need to run this again:

           

          cd build

           

          mvn clean install -DskipTests=true -Dcheckstyle.skip=true -P build,release

           

          Regards,

          Palo

          • 2. Re: Richfaces build question: how to build a specific version with a patch
            Darius Ski Newbie

            Hi,

             

            checking out / patching / building the version from the master ( 4.3.0.Snapshot at the moment) works just fine, I do:

            git clone git://github.com/richfaces/build.git

            cd build

            cd ..

            bash build/scripts/richgit.sh -t git

            change the source file I need followed by:

            mvn clean install -DskipTests=true -Dcheckstyle.skip=true -P build,release

             

            I endup with properly built jars with my modifications in.

             

            What I am having trouble with is - doing the same, but for specific version of Richfaces. For example I want to checkout 4.2.3.Final, change the source file and build a jar, that is different from official release only by my change.

            I have outlined the steps I am it with in my first post, but for whatever reason the jar files built do not change.

             

            Regards,

            Darius.

            • 3. Re: Richfaces build question: how to build a specific version with a patch
              Brian Leathem Master

              Be sure to check out this resource: https://community.jboss.org/wiki/RichFaces4xReleaseProcedure

              It has a lot of good info in it.

               

              So the steps you want are:

               

              1. git clone git://github.com/richfaces/build.git
              2. // Clone all the required repositories
                bash build/scripts/richgit.sh -t git
              3. //  Checkout in all repos the appropriate tag
                bash build/scripts/richgit.sh -e git checkout <tag>
                //  where <tag> is the tag you are looking to extend from (eg. 4.2.3.20121017-Final)
              4. // create a new git branch
                bash build/scripts/richgit.sh -e git checkout -b myBranch
              5. //  Next thing to do is to increment the version number, so you don't end up confusing maven with two artifacts with the same version
                //  Try changing it to 4.3.2.Final.dariusski
                bash build/scripts/change_version.sh -r -o <development_pom_version> -n <release_pom_version>
              6. //  make your change
                bash build/scripts/richgit.sh -e git add -A
                bash build/scripts/richgit.sh -e "git commit -m 'changing version to <release_pom_version>'"
              7. // now do the build
                mvn -P build,release clean install

               

              This should create jars with the RichFaces version you specified above.  And them to your local maven repository with "mvn install:install-file ..." or upload it to your nexus/artifactory deployment.

               

              FYI: This will be *way* easier when we move to the new build structure in RichFaces 5.

               

              Brian Leathem

              • 4. Re: Richfaces build question: how to build a specific version with a patch
                Darius Ski Newbie

                Hi,

                 

                Brian, thanks a lot for Your help. I am also looking forward to RF5, hopefully the process is less custom and more vanilla git action in the future

                 

                Here are the exact steps I have used to build 4.2.3.Final with my changes:

                 

                git clone git://github.com/richfaces/build.git

                bash build/scripts/richgit.sh -t git

                // at this step it is necessary to get the name of a tag, so cd to build dir and execute "git tag -l", don't forget to return to the build root before proceeding

                bash build/scripts/richgit.sh -e git checkout 4.2.3.20121017-Final

                bash build/scripts/richgit.sh -e git checkout -b myBranch

                bash build/scripts/change_version.sh -r -o 4.2.3.Final -n 4.2.3.Final.D

                // made my changes to the files at this step

                bash build/scripts/richgit.sh -e git add -A

                bash build/scripts/richgit.sh -e "git commit -m 'changing version to D'"

                mvn clean install -DskipTests=true -Dcheckstyle.skip=true -P build,release