building.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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 checkout 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 multiwar:multiwar</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>Installing commons-attributes-plugin</h2>
  58. <p>To properly integrate Commons Attributes with Maven (as required by
  59. the <a href="/multiproject/acegi-security-sample-attributes/index.html">Attributes Sample</a>),
  60. you need to install an additional plugin.</b></p>
  61. <p>To install the <code>commons-attributes-plugin</code>, execute the following commands:</p>
  62. <ol>
  63. <pre>cd $ACEGI_SECURITY/doc</pre>
  64. <pre>maven plugin:download
  65. -DgroupId=commons-attributes-plugin
  66. -DartifactId=commons-attributes-plugin
  67. -Dversion=2.1</pre>
  68. </ol>
  69. <p>The second (final) command should be executed on a single line.</p>
  70. <h2>Building All JARs</h2>
  71. <p>Sometimes people are already using Acegi Security, and they just want to build the
  72. latest code from CVS. To build all artifacts (JARs) and install them into
  73. your local Maven repository, simply perform a CVS checkout and install the
  74. <code>commons-attributes-plugin</code> (as detailed above), and then
  75. execute:</p>
  76. <ol>
  77. <pre>cd $ACEGI_SECURITY/doc</pre>
  78. <pre>maven multiproject:install</pre>
  79. </ol>
  80. <p>You can then check your <code>$HOME/.maven/repository/acegisecurity</code>
  81. directory and it should contain all of the latest Acegi Security JARs.</p>
  82. <h2>Building The Site</h2>
  83. <p>By "site" we mean the web site you can browse at
  84. <a href="http://acegisecurity.sourceforge.net">http://acegisecurity.sourceforge.net</a>,
  85. which includes the reference documentation and all of the Maven reports.
  86. If you'd like a local copy, simply execute:
  87. <ol>
  88. <pre>cd $ACEGI_SECURITY/doc</pre>
  89. <pre>maven -Dpassword= changelog:create-cvspass</pre>
  90. <pre>maven multiproject:clean multiproject:site
  91. -Dmaven.jar.override=on
  92. -Dmaven.jar.clover-ant=1.3.3_01
  93. </pre>
  94. </ol>
  95. <p>As per the
  96. <a href="http://maven.apache.org/reference/plugins/changelog/">Maven Changelog Plugin Documentation</a>,
  97. you must tell the plugin the "anonymous CVS pserver" password is blank. This is
  98. why there is the "create-cvspass" command shown above. You should only need to
  99. do this once.</p>
  100. <h2>Memory and Clover Workarounds</h2>
  101. <p>If you get an <code>OutOfMemoryError</code>, simply execute the following before
  102. calling Maven:</p>
  103. <ol>
  104. <pre>set MAVEN_OPTS=-Xmx512m</pre>
  105. </ol>
  106. <p>If you get an <code>[ERROR] Invalid license: Invalid license file [E1202]</code>,
  107. this is because the <code>maven-clover-plugin</code> is using an old version of
  108. <code>clover-ant-xxx.jar</code>. Whilst Acegi Security's <code>project.properties</code>
  109. specifies a newer version, subprojects have an inheritence problem and don't pick
  110. this up (as of the time of writing). To workaround this issue, you need to
  111. specify those override properties on the command line. For example, to execute the
  112. Clover reports for the core subproject, you would do the following:</p>
  113. <ol>
  114. <pre>cd $ACEGI_SECURITY/core</pre>
  115. <pre>maven clover:html-report -Dmaven.jar.override=on -Dmaven.jar.clover-ant=1.3.3_01</pre>
  116. </ol>
  117. <h2>CVS-over-SSH Workarounds</h2>
  118. <p>Another possible problem is related to CVS-over-SSH ("ext" in CVSROOT) appearing to freeze.
  119. The following instructions assume you're an Acegi Security developer who has CVS access
  120. to the project, as if you're not then you shouldn't be trying to use CVS-over-SSH.
  121. The instructions above all relate to goals which use the default, anonymous
  122. pserver CVS repository.</p>
  123. <p>If you really need authenticated SSH-based access, first check your
  124. <code>$ACEGI_SECURITY/build.properties</code> contains a
  125. <code>maven.username</code> equal to your SourceForge username. If your Maven CVS
  126. or SSH commands still don't work, test you have automatic CVS-over-SSH access operational
  127. by executing the following command:</p>
  128. <ol>
  129. <pre>cvs -d :ext:YOUR_SOURCEFORGE_USERNAME@cvs.sourceforge.net:/cvsroot/acegisecurity</pre>
  130. </ol>
  131. <p>If this CVS command executes without requiring any interaction such as password
  132. entry, you're ready to proceed. If it fails (or requires a password entry), you
  133. probably need to review your CVS setup. This varies depending on your CVS client.</p>
  134. <p>One Windows-based command line CVS-over-SSH-with-auto-login setup that
  135. works very well is to install
  136. <a href="http://www.cvsnt.com/">CVSNT</a> (which has a CVS client console utility)
  137. and
  138. <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> (download
  139. <code>putty.zip</code>) together, and use
  140. PuTTY's Pageant to automatically authenticate. A resource that describes in detail
  141. how to configure WinCVS (which internally uses CVSNT's command line client) with PuTTY
  142. (including automatic SSH authentication) is
  143. <a href="http://sourceforge.net/docman/display_doc.php?docid=766&group_id=1">SourceForge's instructions</a>.
  144. One issue with the SourceForge instructions is they forget to mention how to
  145. tell the CVS command-line client to use <code>plink.exe</code>, which is PuTTY's SSH command-line
  146. version. The solution is to execute
  147. <code>set CVS_RSH=C:\Program Files\putty\plink.exe</code>
  148. (or whatever path is appropriate to plink) before running the CVS command line.
  149. In fairness, the SourceForge instructions target the Windows front-end to CVS, whilst
  150. we need the command-line version to work.</p>
  151. <p>It is worth noting that as the Maven project uses the anonymous pserver
  152. repository for most operations, these setup instructions really only apply if
  153. doing something like deploying the site over SSH etc.</p>
  154. </body>
  155. </html>