使用 Maven 从头开始构建 CAS war
Building CAS war from scratch with Maven
我是 Maven 的新手,但已经使用 Ant 多年,最近还广泛使用 Gradle。
我正在尝试克隆并(在本地)构建一个名为 Apereo(以前称为 Jasig)的 Maven 项目 Central Authentication Service (CAS)。这是一个 Java 网络应用程序,在 SSO 服务中扮演票务商店(类似于 Kerberos)的角色。通常,要使用 CAS 作为您的 SSO 服务器,您可以使用 Maven 覆盖方法默认引入它们的 JARs/WARs,如果您想提供您的服务,您只需覆盖这些默认值自己的自定义文件。
但这不是我想要的。我想在本地构建 CAS 项目,并为其创建自己的 changes/tweaks。所以我从 GitHub 克隆了它,并在其根“cas/
”目录中发布了一个 mvn war:war
。我看到了 lot 的输出,以:
结尾
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar (227 KB at 1423.8 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/com/thoughtworks/xstream/xstream/1.4.3/xstream-1.4.3.jar (471 KB at 804.2 KB/sec)
[INFO] Packaging webapp
[INFO] Assembling webapp [cas-server] in [D:\ih8windows\cas\target\cas-server-4.1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Webapp assembled in [213 msecs]
[INFO] Building war: D:\ih8windows\cas\target\cas-server-4.1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apereo Central Authentication Service ............. FAILURE [ 11.779 s]
[INFO] Apereo CAS Core ................................... SKIPPED
[INFO] Apereo CAS Generic Support ........................ SKIPPED
[INFO] Apereo CAS Web Application support ................ SKIPPED
[INFO] Apereo CAS Web Application ........................ SKIPPED
[INFO] Apereo CAS JDBC Support ........................... SKIPPED
[INFO] Apereo CAS LDAP Support ........................... SKIPPED
[INFO] Apereo CAS Legacy Support ......................... SKIPPED
[INFO] Apereo CAS OpenId Server Support .................. SKIPPED
[INFO] Apereo CAS RADIUS Support ......................... SKIPPED
[INFO] Apereo CAS SPNEGO/NTLM Support .................... SKIPPED
[INFO] Apereo CAS Trusted User Support ................... SKIPPED
[INFO] Apereo CAS X.509 Client Certificate Support ....... SKIPPED
[INFO] Apereo CAS OAuth Server Support ................... SKIPPED
[INFO] Apereo CAS Client Protocols Support using pac4j ... SKIPPED
[INFO] Apereo CAS SAML Server and Validation Support ..... SKIPPED
[INFO] Apereo CAS JBoss Cache Integration - DEPRECATED ... SKIPPED
[INFO] Apereo CAS Memcached Integration .................. SKIPPED
[INFO] Apereo CAS Ehcache Integration .................... SKIPPED
[INFO] Apereo CAS Restlet Integration - DEPRECATED ....... SKIPPED
[INFO] Apereo CAS - Uber WAR - DEPRECATED ................ SKIPPED
[INFO] Apereo CAS ClearPass Extension .................... SKIPPED
[INFO] Apereo CAS Management Web Application ............. SKIPPED
[INFO] Apereo CAS REST Implementation .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.142 s
[INFO] Finished at: 2015-01-10T13:56:35-05:00
[INFO] Final Memory: 24M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-cli) on project cas-server: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
当我去 target/
时,我看到一个 cas-server-4.1.0-SNAPSHOT.war
,但它是空的!
理想情况下,我希望它的所有子项目都捆绑在同一个工件中 (JAR/WAR)。但如果那不可能,那么我需要构建和打包 cas-server-webapp
和 cas-server-core
子项目,这样我就可以启动它们并在本地对它们进行更改。所以我问:如果 mvn war:war
不是实现此目标的方法,那什么是?
而不是 mvn war:war
在主目录中尝试 运行 mvn package
。它将允许 Maven 为每个 cas
模块选择合适的打包类型。该项目由许多模块组成,并非所有模块都应打包为 WAR。例如,父项目(失败的项目)具有 pom
打包类型,这意味着它不构建任何东西而是调用子模块。
当 mvn package
完成后,您应该能够找到组装好的 cas-server-webapp/target/cas.war
文件。
我是 Maven 的新手,但已经使用 Ant 多年,最近还广泛使用 Gradle。
我正在尝试克隆并(在本地)构建一个名为 Apereo(以前称为 Jasig)的 Maven 项目 Central Authentication Service (CAS)。这是一个 Java 网络应用程序,在 SSO 服务中扮演票务商店(类似于 Kerberos)的角色。通常,要使用 CAS 作为您的 SSO 服务器,您可以使用 Maven 覆盖方法默认引入它们的 JARs/WARs,如果您想提供您的服务,您只需覆盖这些默认值自己的自定义文件。
但这不是我想要的。我想在本地构建 CAS 项目,并为其创建自己的 changes/tweaks。所以我从 GitHub 克隆了它,并在其根“cas/
”目录中发布了一个 mvn war:war
。我看到了 lot 的输出,以:
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar (227 KB at 1423.8 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/com/thoughtworks/xstream/xstream/1.4.3/xstream-1.4.3.jar (471 KB at 804.2 KB/sec)
[INFO] Packaging webapp
[INFO] Assembling webapp [cas-server] in [D:\ih8windows\cas\target\cas-server-4.1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Webapp assembled in [213 msecs]
[INFO] Building war: D:\ih8windows\cas\target\cas-server-4.1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apereo Central Authentication Service ............. FAILURE [ 11.779 s]
[INFO] Apereo CAS Core ................................... SKIPPED
[INFO] Apereo CAS Generic Support ........................ SKIPPED
[INFO] Apereo CAS Web Application support ................ SKIPPED
[INFO] Apereo CAS Web Application ........................ SKIPPED
[INFO] Apereo CAS JDBC Support ........................... SKIPPED
[INFO] Apereo CAS LDAP Support ........................... SKIPPED
[INFO] Apereo CAS Legacy Support ......................... SKIPPED
[INFO] Apereo CAS OpenId Server Support .................. SKIPPED
[INFO] Apereo CAS RADIUS Support ......................... SKIPPED
[INFO] Apereo CAS SPNEGO/NTLM Support .................... SKIPPED
[INFO] Apereo CAS Trusted User Support ................... SKIPPED
[INFO] Apereo CAS X.509 Client Certificate Support ....... SKIPPED
[INFO] Apereo CAS OAuth Server Support ................... SKIPPED
[INFO] Apereo CAS Client Protocols Support using pac4j ... SKIPPED
[INFO] Apereo CAS SAML Server and Validation Support ..... SKIPPED
[INFO] Apereo CAS JBoss Cache Integration - DEPRECATED ... SKIPPED
[INFO] Apereo CAS Memcached Integration .................. SKIPPED
[INFO] Apereo CAS Ehcache Integration .................... SKIPPED
[INFO] Apereo CAS Restlet Integration - DEPRECATED ....... SKIPPED
[INFO] Apereo CAS - Uber WAR - DEPRECATED ................ SKIPPED
[INFO] Apereo CAS ClearPass Extension .................... SKIPPED
[INFO] Apereo CAS Management Web Application ............. SKIPPED
[INFO] Apereo CAS REST Implementation .................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.142 s
[INFO] Finished at: 2015-01-10T13:56:35-05:00
[INFO] Final Memory: 24M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-cli) on project cas-server: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
当我去 target/
时,我看到一个 cas-server-4.1.0-SNAPSHOT.war
,但它是空的!
理想情况下,我希望它的所有子项目都捆绑在同一个工件中 (JAR/WAR)。但如果那不可能,那么我需要构建和打包 cas-server-webapp
和 cas-server-core
子项目,这样我就可以启动它们并在本地对它们进行更改。所以我问:如果 mvn war:war
不是实现此目标的方法,那什么是?
而不是 mvn war:war
在主目录中尝试 运行 mvn package
。它将允许 Maven 为每个 cas
模块选择合适的打包类型。该项目由许多模块组成,并非所有模块都应打包为 WAR。例如,父项目(失败的项目)具有 pom
打包类型,这意味着它不构建任何东西而是调用子模块。
当 mvn package
完成后,您应该能够找到组装好的 cas-server-webapp/target/cas.war
文件。