1 17 package org.apache.avalon.fortress.tools; 18 19 import java.util.ArrayList ; 20 21 import org.apache.maven.plugin.MojoExecutionException; 22 import org.apache.maven.plugin.MojoFailureException; 23 import org.apache.maven.plugin.logging.Log; 24 25 38 public class ComponentMetaMavenMojo extends AbstractQDoxMojo 39 { 40 41 44 private class MavenBuildLogger implements BuildLogger 45 { 46 private Log m_logger; 47 48 private MavenBuildLogger() 49 { 50 } 52 53 public MavenBuildLogger( Log logger ) 54 { 55 m_logger = logger; 56 } 57 58 public void debug( String message ) 59 { 60 m_logger.debug( message ); 61 } 62 63 public void error( String message ) 64 { 65 m_logger.error( message ); 66 } 67 68 public void info( String message ) 69 { 70 m_logger.info( message ); 71 } 72 73 public void warn( String message ) 74 { 75 m_logger.warn( message ); 76 } 77 } 78 79 public void execute() throws MojoExecutionException, MojoFailureException 80 { 81 82 validate(); 83 84 getLog().info( "Writing Info descriptors as property files (.meta)." ); 85 86 super.execute(); 87 88 ComponentMetaInfoCollector collector = new ComponentMetaInfoCollector( new MavenBuildLogger( getLog() ) ); 89 collector.setAllClasses( getAllClasses() ); 90 collector.setDestDir( getDestDir() ); 91 try 92 { 93 collector.execute(); 94 } 95 catch ( Exception e ) 96 { 97 throw new MojoExecutionException( e.getMessage(), e ); 98 } 99 } 100 101 private ArrayList getAllClasses() 102 { 103 return allClasses; 104 } 105 106 private void validate() 107 { 108 } 109 110 } 111 | Popular Tags |