Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Mojarra from source

I downloaded the Mojarra source code from here. I also downloaded the pom file to build the source code files. It turns out that the code structure is different from the original and I need to create directories and but the files there.

I created this directory structure:

laptop@Laptop javax.faces-2.1.9-sources]$ tree

.
|-- pom.xml
`-- src
    `-- main
        |-- java
        |   |-- com
        |   |   `-- sun
        |   |       `-- faces ....(other sub directories)
        |   `-- javax
        |       `-- faces ....(other sub directories)
        `-- resources
            `-- META-INF
                `-- MANIFEST.MF

I created the directories src, main, java and resources and I placed the source code directories in those directories but it's not working. What is the proper way to place the source code files into the the package?

Best wishes

like image 951
user1285928 Avatar asked Oct 08 '22 14:10

user1285928


1 Answers

As of Jan 16, 2017, you can build Mojarra using the following steps:

Note: building Mojarra requires that ant and maven be installed on your system. It also requires that you are using the correct JDK version:

  • For Mojarra 2.3.x use JDK 8 (or 1.8).
  • For Mojarra 2.2.x use JDK 7 (or 1.7).
  • For Mojarra 2.1.x use JDK 6 (or 1.6) (I haven't actually tested this).

  1. Download the source from git://java.net/mojarra~git:

    git clone git://java.net/mojarra~git
    
  2. Navigate to your new mojarra~git directory:

    cd mojarra~git/
    
  3. Copy build.properties.glassfish to build.properties:

    cp build.properties.glassfish build.properties
    
  4. Set the jsf.build.home property in your build.properties file:

    jsf.build.home=/path/to/mojarra
    

    Here's a (GNU) sed command to do this:

    sed -i "s|jsf[.]build[.]home=.*|jsf.build.home=$PWD|" build.properties
    
  5. Mojarra 2.3.x Note: skip this step.

    Run ant to build the Mojarra build tools:

    ant main clean main
    
  6. Run one of the following ant commands to build Mojarra:

    1. Run the following command if you want to build Mojarra as a single javax.faces.jar:

      ant clean main mvn.deploy.snapshot.local
      

      The newly built Mojarra jar will be located in jsf-ri/build/mvn/target as javax.faces-${mojarra.version}.jar.

      Mojarra 2.3.x Note: the newly built JSF/Mojarra API jar will be located in jsf-api/build/mvn/target as javax.faces-api-${mojarra.version}.jar.

    2. Mojarra 2.3.x Note: this command may not work for Mojarra 2.3.x.

      Run the following command if you want to build Mojarra as a two jars, jsf-api.jar and jsf-impl.jar:

      ant clean main mvn.pre-maven-rename.deploy.snapshot.local
      

      The newly built Mojarra API jar will be located in jsf-api/build.pre-maven-rename/mvn-pre-maven-rename/target as jsf-api-${mojarra.version}.jar. The newly built Mojarra jar will be located in jsf-ri/build.pre-maven-rename/mvn-pre-maven-rename/target as jsf-impl-${mojarra.version}.jar.

The Mojarra snapshot jar(s) will also be installed in your local ~/.m2/ repository for maven purposes.

like image 110
stiemannkj1 Avatar answered Oct 13 '22 10:10

stiemannkj1