in tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java [1316:1349]
protected ClassRealm getTomcatClassLoader()
throws MojoExecutionException
{
if ( this.tomcatRealm != null )
{
return tomcatRealm;
}
try
{
ClassWorld world = new ClassWorld();
ClassRealm root = world.newRealm( "tomcat", Thread.currentThread().getContextClassLoader() );
for ( @SuppressWarnings("rawtypes") Iterator i = pluginArtifacts.iterator(); i.hasNext(); )
{
Artifact pluginArtifact = (Artifact) i.next();
// add all plugin artifacts see https://issues.apache.org/jira/browse/MTOMCAT-122
if ( pluginArtifact.getFile() != null )
{
root.addURL( pluginArtifact.getFile().toURI().toURL() );
}
}
tomcatRealm = root;
return root;
}
catch ( DuplicateRealmException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
catch ( MalformedURLException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}