building.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!--
  2. * ========================================================================
  3. *
  4. * Copyright 2004 Acegi Technology Pty Limited
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * ========================================================================
  19. -->
  20. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  21. <html xmlns="http://www.w3.org/1999/xhtml">
  22. <head>
  23. <title>Building</title>
  24. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  25. </head>
  26. <body>
  27. <h1>Building Acegi Security System</h1>
  28. <h2>Checking Out from CVS </h2>
  29. <p>This project uses <a href="http://maven.apache.org">Maven</a> as project manager
  30. and build tool. We recommend you to install Maven 1.0.2 or greater before trying
  31. the following. <b>Note there are workarounds at the bottom of this page.</b></p>
  32. <p>To ancheckout Acegi Security from CVS, execute the following command on a
  33. single line:</p>
  34. <ol>
  35. <pre>maven scm:checkout-project
  36. -Dmaven.scm.method=cvs
  37. -Dmaven.scm.cvs.module=acegisecurity
  38. -Dmaven.scm.cvs.root=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/acegisecurity
  39. -Dmaven.scm.checkout.dir=acegisecurity</pre>
  40. </ol>
  41. <h2>Quick Build</h2>
  42. <p>Often people reading this document just want to see if Acegi Security will work
  43. for their projects. They want to deploy a sample application, and that's about it
  44. (after all, all the reference documentation can be read online at
  45. <a href="http://acegisecurity.sourceforge.net">http://acegisecurity.sourceforge.net</a>).
  46. In this case, execute:</p>
  47. <ol>
  48. <pre>cd $ACEGI_SECURITY/core</pre>
  49. <pre>maven jar:install</pre>
  50. <pre>cd $ACEGI_SECURITY/samples/contacts</pre>
  51. <pre>maven war</pre>
  52. <pre>copy $ACEGI_SECURITY/samples/contacts/target/acegi-security-sample-contacts-filter.war $YOUR_CONTAINER/webapps</pre>
  53. </ol>
  54. <p>Then load up your web container and visit
  55. <a href="http://localhost:8080/acegi-security-sample-contacts-filter/">http://localhost:8080/acegi-security-sample-contacts-filter/</a>
  56. (or whatever location is appropriate for your web container).</p>
  57. <h2>Building All JARs</h2>
  58. <p>Sometimes people are already using Acegi Security, and they just want to build the
  59. latest code from CVS. To build all artifacts (JARs) and install them into
  60. your local Maven repository, simple execute:</p>
  61. <ol>
  62. <pre>cd $ACEGI_SECURITY/</pre>
  63. <pre>maven multiproject:install</pre>
  64. </ol>
  65. <p>You can then check your <code>$HOME/.maven/repository/acegisecurity</code>
  66. directory and it should contain all of the latest Acegi Security JARs.</p>
  67. <h2>Building The Site</h2>
  68. <p>By "site" we mean the web site you can browse at
  69. <a href="http://acegisecurity.sourceforge.net">http://acegisecurity.sourceforge.net</a>,
  70. which includes the reference documentation and all of the Maven reports.
  71. If you'd like a local copy, simply execute:
  72. <ol>
  73. <pre>cd $ACEGI_SECURITY/doc</pre>
  74. <pre>maven -Dpassword= changelog:create-cvspass</pre>
  75. <pre>maven multiproject:clean multiproject:site
  76. -Dmaven.jar.override=on
  77. -Dmaven.jar.clover-ant=1.3.3_01
  78. </pre>
  79. </ol>
  80. <p>As per the
  81. <a href="http://maven.apache.org/reference/plugins/changelog/">Maven Changelog Plugin Documentation</a>,
  82. you must tell the plugin the "anonymous CVS pserver" password is blank. This is
  83. why there is the "create-cvspass" command shown above. You should only need to
  84. do this once.</p>
  85. <h2>Memory and Clover Workarounds</h2>
  86. <p>If you get an <code>OutOfMemoryError</code>, simply execute the following before
  87. calling Maven:</p>
  88. <ol>
  89. <pre>set MAVEN_OPTS=-Xmx512m</pre>
  90. </ol>
  91. <p>If you get an <code>[ERROR] Invalid license: Invalid license file [E1202]</code>,
  92. this is because the <code>maven-clover-plugin</code> is using an old version of
  93. <code>clover-ant-xxx.jar</code>. Whilst Acegi Security's <code>project.properties</code>
  94. specifies a newer version, subprojects have an inheritence problem and don't pick
  95. this up (as of the time of writing). To workaround this issue, you need to
  96. specify those override properties on the command line. For example, to execute the
  97. Clover reports for the core subproject, you would do the following:</p>
  98. <ol>
  99. <pre>cd $ACEGI_SECURITY/core</pre>
  100. <pre>maven clover:html-report -Dmaven.jar.override=on -Dmaven.jar.clover-ant=1.3.3_01</pre>
  101. </ol>
  102. <h2>CVS-over-SSH Workarounds</h2>
  103. <p>Another possible problem is related to CVS-over-SSH ("ext" in CVSROOT) appearing to freeze.
  104. The following instructions assume you're an Acegi Security developer who has CVS access
  105. to the project, as if you're not then you shouldn't be trying to use CVS-over-SSH.
  106. The instructions above all relate to goals which use the default, anonymous
  107. pserver CVS repository.</p>
  108. <p>If you really need authenticated SSH-based access, first check your
  109. <code>$ACEGI_SECURITY/build.properties</code> contains a
  110. <code>maven.username</code> equal to your SourceForge username. If your Maven CVS
  111. or SSH commands still don't work, test you have automatic CVS-over-SSH access operational
  112. by executing the following command:</p>
  113. <ol>
  114. <pre>cvs -d :ext:YOUR_SOURCEFORGE_USERNAME@cvs.sourceforge.net:/cvsroot/acegisecurity</pre>
  115. </ol>
  116. <p>If this CVS command executes without requiring any interaction such as password
  117. entry, you're ready to proceed. If it fails (or requires a password entry), you
  118. probably need to review your CVS setup. This varies depending on your CVS client.</p>
  119. <p>One Windows-based command line CVS-over-SSH-with-auto-login setup that
  120. works very well is to install
  121. <a href="http://www.cvsnt.com/">CVSNT</a> (which has a CVS client console utility)
  122. and
  123. <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> (download
  124. <code>putty.zip</code>) together, and use
  125. PuTTY's Pageant to automatically authenticate. A resource that describes in detail
  126. how to configure WinCVS (which internally uses CVSNT's command line client) with PuTTY
  127. (including automatic SSH authentication) is
  128. <a href="http://sourceforge.net/docman/display_doc.php?docid=766&group_id=1">SourceForge's instructions</a>.
  129. One issue with the SourceForge instructions is they forget to mention how to
  130. tell the CVS command-line client to use <code>plink.exe</code>, which is PuTTY's SSH command-line
  131. version. The solution is to execute
  132. <code>set CVS_RSH=C:\Program Files\putty\plink.exe</code>
  133. (or whatever path is appropriate to plink) before running the CVS command line.
  134. In fairness, the SourceForge instructions target the Windows front-end to CVS, whilst
  135. we need the command-line version to work.</p>
  136. <p>It is worth noting that as the Maven project uses the anonymous pserver
  137. repository for most operations, these setup instructions really only apply if
  138. doing something like deploying the site over SSH etc.</p>
  139. </body>
  140. </html>