1. Edit your project's project.xml to make sure Ashcroft is among your dependencies:
    <!-- Test time only -->
    <dependency>
      <id>ashcroft</id>
      <version>0.1</version>
    </dependency>
    
  2. Edit project.properties to enable Ashcroft:
    # make sure the ashcroft jar you're using is available in the remote repository (it is at codehaus)
    maven.repo.remote=http://www.ibiblio.org/maven,http://dist.codehaus.org
    
    # install ashcroft as your security manager
    maven.junit.jvmargs=-Djava.security.manager=com.thoughtworks.ashcroft.runtime.JohnAshcroft
    
    # make sure the jvm forks, otherwise the jvmargs will be ignored
    maven.junit.fork=true
    

Also see Ashcroft Configuration for a full list of configuration options.