Use Hudson + Maven. Hudson will capture the console output and errors for you.


On 10/14/09, harishsyndrome <harish.kum...@tcs.com> wrote:
>
> Thanks for your reply.
>
> But My requirment is quite different.
> For Example:
>
>
>
>> public class mavenEmbedded
>> {
>>      public static void main(String args[])
>>      {
>>              try
>>              {
>>              File projectDirectory = new File( getBasedir(),
>> "src/examples/simple-project" );
>>
>>         File user = new File( projectDirectory, "settings.xml" );
>>
>>         Configuration configuration = new DefaultConfiguration()
>>             .setUserSettingsFile( user )
>>             .setClassLoader(
>> Thread.currentThread().getContextClassLoader() );
>>
>>         ConfigurationValidationResult validationResult =
>> MavenEmbedder.validateConfiguration( configuration );
>>
>>         if ( validationResult.isValid() )
>>         {
>>             MavenEmbedder embedder = new MavenEmbedder( configuration );
>>
>>             MavenExecutionRequest request = new
>> DefaultMavenExecutionRequest()).setBaseDirectory( projectDirectory
>> ).setGoals( Arrays.asList( new String[]{"clean", "install"} ) );
>>
>>             MavenExecutionResult result = embedder.execute(request);
>>
>>             if ( result.hasExceptions() )
>>             {
>>                 fail( ((Exception)result.getExceptions().get( 0
>> )).getMessage() );
>>             }
>>
>>             //
>> ----------------------------------------------------------------------------
>>             // You may want to inspect the project after the execution.
>>             //
>> ----------------------------------------------------------------------------
>>
>>             MavenProject project = result.getProject();
>>
>>             // Do something with the project
>>
>>             String groupId = project.getGroupId();
>>
>>             String artifactId = project.getArtifactId();
>>
>>             String version = project.getVersion();
>>
>>             String name = project.getName();
>>
>>             String environment = project.getProperties().getProperty(
>> "environment" );
>>
>> //            assertEquals( "development", environment );
>>
>>             System.out.println( "You are working in the '" + environment +
>> "' environment!" );
>>         }
>>         else
>>         {
>>             if ( ! validationResult.isUserSettingsFilePresent() )
>>             {
>>                 System.out.println( "The specific user settings file '" +
>> user + "' is not present." );
>>             }
>>             else if ( ! validationResult.isUserSettingsFileParses() )
>>             {
>>                 System.out.println( "Please check your settings file, it
>> is not well formed XML." );
>>             }
>>         }
>>              }
>>              
>>              catch(Exception e)
>>              {
>>                      e.printStackTrace();
>>              }
>>
>>
>>      }
>>
>> }
>>
>
> This part of Code inputs a Project Folder and Does Clean and Install tasks
> of Maven. This is my service method which does of Compiliing the Code.
>
>
> If there exists an error in the project. The Error/Warning/Logs will  be
> thrown to the Console.I want that error messages to be shown in the Web
> Page.
>
> One way, i can have a Logger and reflect the logger in the web page. I dont
> want to do that. IAm looking for any Api/Jar (Not War or Ear) which can do
> the work.
>
> Thanks again for your reply. And i need some more help from
> here...Desperately.
> --
> View this message in context:
> http://www.nabble.com/How-to-display-transfer-maven-compilation-errors-logs-in-Web-page-tp25867220p25888247.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to