building.html 8.0 KB

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