[ http://jira.codehaus.org/browse/CONTINUUM-243?page=comments#action_67484 
] 

Baerrach bonDierne commented on CONTINUUM-243:
----------------------------------------------

For those doing any investigation, this is what I have found so far. 
I don't have the time to hack this and see if it will work. Well after spending 
the 30-60 minutes analysing this maybe later since I feel this is pretty 
close...

MavenTwoContinuumProjectBuilder.java contains
            String defaultGoal = "clean install";
hard coded, as well as
            bd.setArguments( "--batch-mode --non-recursive" );

These should probably be available to be configured from ConfigureContinuum.vm 
via the continuum.configuration property.

To create these values in configuration it looks like you need to modify 
continuum.mdo -> SystemConfiguration and  you would add two more fields 
defaultGoal and defaultGoalArguments.

But I am unable to work out how to get hold of the configuration within 
MavenTwoContinuumProjectBuilder so  you can access these values.

It might be as simple as adding
    /**
     * @plexus.requirement
     */
    private ConfigurationService configurationService;
to CreateProjectsFromMetadata (since that's how DeployArtifactContinuumAction 
gets hold of a reference)

However the CreateProjectsFromMetadata uses projectBuilderManager to obtain the 
project builder, which gives you the MavenTwoContinuumProjectBuilder, but there 
is nothing to add extra values to these project builders.  It is 
MavenTwoContinuumProjectBuilder that needs these default values.

DefaultContinuumProjectBuilderManager uses a map of project builders, and not 
understanding the black magic within plexus/components.xml it looks like 
components with a role of "ContinuumProjectBuilder" are added automatically to 
the project builder list. 

Ahh, so we should be able to add
    /**
     * @plexus.requirement
     */
    private ConfigurationService configurationService;
Not to the action, but to MavenTwoContinuumProjectBuilder and then in 
plexus/components.xml hook up 
the component by adding:
      <requirements>
        <requirement>
          
<role>org.apache.maven.continuum.configuration.ConfigurationService</role>
        </requirement>

Then it should be a matter of replacing
            String defaultGoal = "clean install";
            bd.setArguments( "--batch-mode --non-recursive" );
in MavenTwoContinuumProjectBuilder  with
            String defaultGoal = configurationService.getDefaultGoal();
            bd.setArguments( configurationService.getDefaultGoalArguments() );

The next steps would be working out how the web app stuff works so that you can 
actually set these values correctly from EditContinuumConfiguration.vm

> Ability to mass edit projects or define default goal
> ----------------------------------------------------
>
>          Key: CONTINUUM-243
>          URL: http://jira.codehaus.org/browse/CONTINUUM-243
>      Project: Continuum
>         Type: New Feature

>   Components: Web interface
>     Versions: 1.0-alpha-3
>     Reporter: Yann Le Du
>     Priority: Minor

>
>
> At the moment, the default goal for a new project is "clean:clean install".
> Say we want to make it "clean:clean install site:site site:deploy" for one 
> project --> OK. But say for 10 or more projects...
> The idea would be to :
> * either to mass edit project goals
> * either to define a custom default goal for new projects
> Hope it is clear enough...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to