如何从源代码构建Mojarra

5
我从这里下载了Mojarra源代码,并下载了pom文件构建源代码文件。结果发现代码结构与原始的不同,我需要创建目录并将文件放在其中。
我创建了以下目录结构:
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

我创建了目录 srcmainjavaresources,并将源代码目录放入这些目录中,但它无法工作。将源代码文件放入包中的适当方法是什么?
祝一切顺利。
1个回答

4
截至2017年1月16日,您可以按照以下步骤构建Mojarra:
注意:构建Mojarra需要在系统上安装ant和maven。还需要使用正确的JDK版本:
- 对于Mojarra 2.3.x,请使用JDK 8(或1.8)。 - 对于Mojarra 2.2.x,请使用JDK 7(或1.7)。 - 对于Mojarra 2.1.x,请使用JDK 6(或1.6)(我实际上没有测试过)。
  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.

Mojarra快照jar包也会被安装在本地的~/.m2/仓库中,以便于Maven使用。


在构建MOJARRA_2_2X_ROLLING时,您可能会在从Sourceforge下载依赖项时遇到SSL异常或握手错误。 您可以通过更新JRE的证书来解决此问题。 我发现最简单的更新方法是将**cacerts**文件从较新的JDK复制到:cp $ JDK_8_HOME/jre/lib/security/cacerts $ JDK_7_HOME/jre/lib/security/cacerts - stiemannkj1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接