continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r548732 [1/3] - in /maven/continuum/trunk: ./ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/installation/ continuum-api/src/main/java/org/apache/maven/continuum/profile/ conti...
Date Tue, 19 Jun 2007 14:04:17 GMT
Author: evenisse
Date: Tue Jun 19 07:04:13 2007
New Revision: 548732

URL: http://svn.apache.org/viewvc?view=rev&rev=548732
Log:
[CONTINUUM-44] Add Installations/Profiles screens
Submitted by: Olivier Lamy

Added:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java   (with props)
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java   (with props)
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java   (with props)
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java   (with props)
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java   (with props)
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java   (with props)
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializerTest.java   (with props)
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/DefaultInstallationServiceTest.java   (with props)
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/DefaultProfileServiceTest.java   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/InstallationAction.java   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/resources/template/profile/
    maven/continuum/trunk/continuum-webapp/src/main/resources/template/profile/select.ftl
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editInstallation.jsp   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editProfile.jsp   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/installationsList.jsp   (with props)
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp   (with props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/pom.xml
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
    maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml
    maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
    maven/continuum/trunk/continuum-data-management/data-management-jdo/src/test/java/org/apache/maven/continuum/management/DataManagementToolTest.java
    maven/continuum/trunk/continuum-data-management/data-management-jdo/src/test/resources/expected.xml
    maven/continuum/trunk/continuum-model/pom.xml
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
    maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
    maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addMavenTwoProject.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
    maven/continuum/trunk/pom.xml

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Tue Jun 19 07:04:13 2007
@@ -20,12 +20,14 @@
  */
 
 import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.profile.ProfileService;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
@@ -279,10 +281,10 @@
      * @return a holder with the projects, project groups and errors occurred during the project adding
      * @throws ContinuumException
      */
-    ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId, boolean checkProtocol, 
+    ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId, boolean checkProtocol,
                                                        boolean useCredentialsCache )
         throws ContinuumException;
-    
+
     /**
      * Add a Maven 1 project to the list of projects.
      *
@@ -337,7 +339,7 @@
      * @return a holder with the projects, project groups and errors occurred during the project adding
      * @throws ContinuumException
      */
-    ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId, boolean checkProtocol, 
+    ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId, boolean checkProtocol,
                                                        boolean useCredentialsCache )
         throws ContinuumException;
 
@@ -499,9 +501,16 @@
     void reloadConfiguration()
         throws ContinuumException;
 
-
     // ----------------------------------------------------------------------
     // Continuum Release
     // ----------------------------------------------------------------------
     ContinuumReleaseManager getReleaseManager();
+
+    // ----------------------------------------------------------------------
+    // Installation
+    // ----------------------------------------------------------------------    
+
+    InstallationService getInstallationService();
+
+    ProfileService getProfileService();
 }

Added: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java (added)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,37 @@
+package org.apache.maven.continuum.installation;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 13 juin 07
+ * @version $Id$
+ */
+public class InstallationException
+    extends Exception
+{
+    public InstallationException( String message )
+    {
+        super( message );
+    }
+
+    public InstallationException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java (added)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,77 @@
+package org.apache.maven.continuum.installation;
+
+import java.util.List;
+
+import org.apache.maven.continuum.model.system.Installation;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 13 juin 07
+ * @version $Id$
+ */
+public interface InstallationService
+{
+    String ROLE = InstallationService.class.getName();
+
+    String JDK_TYPE = "jdk";
+
+    String MAVEN2_TYPE = "maven2";
+
+    String MAVEN1_TYPE = "maven1";
+
+    String ANT_TYPE = "ant";
+
+    String ENVVAR_TYPE = "envvar";
+
+    public Installation add( Installation installation )
+        throws InstallationException;
+
+    public void update( Installation installation )
+        throws InstallationException;
+
+    public void delete( Installation installation )
+        throws InstallationException;
+
+    public Installation getInstallation( String name )
+        throws InstallationException;
+
+    public List<Installation> getAllInstallations()
+        throws InstallationException;
+
+    public String getEnvVar( String type );
+
+    /**
+     * @param installation
+     * @return output of JAVA_HOME/bin/java -version (JAVA_HOME = installation.getVarValue()
+     * @throws InstallationException
+     */
+    public List<String> getJdkInformations( Installation installation )
+        throws InstallationException;
+
+    /**
+     * 
+     * @return output of JAVA_HOME/bin/java -version
+     * @throws InstallationException
+     */
+    public List<String> getDefaultJdkInformations()
+        throws InstallationException;
+
+}

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/installation/InstallationService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java (added)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,45 @@
+package org.apache.maven.continuum.profile;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 15 juin 07
+ * @version $Id$
+ */
+public class ProfileException
+    extends Exception
+{
+
+    public ProfileException( String message, Throwable throwable )
+    {
+        super( message, throwable );
+    }
+
+    public ProfileException( String message )
+    {
+        super( message );
+    }
+
+    public ProfileException( Throwable throwable )
+    {
+        super( throwable );
+    }
+
+}

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java (added)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,65 @@
+package org.apache.maven.continuum.profile;
+
+import java.util.List;
+
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 15 juin 07
+ * @version $Id$
+ */
+public interface ProfileService
+{
+    String ROLE = ProfileService.class.getName();
+
+    public Profile getProfile( int profileId )
+        throws ProfileException;
+
+    public void deleteProfile( int profileId )
+        throws ProfileException;
+
+    public void updateProfile( Profile profile )
+        throws ProfileException;
+
+    /**
+     * <b>Add an empty profile without builder, jdk and envVars</b>
+     * @param profile
+     * @return
+     * @throws ProfileException
+     */
+    public Profile addProfile( Profile profile )
+        throws ProfileException;
+
+    public List<Profile> getAllProfiles()
+        throws ProfileException;
+
+    public void setJdkInProfile( Profile profile, Installation jdk )
+        throws ProfileException;
+
+    public void setBuilderInProfile( Profile profile, Installation builder )
+        throws ProfileException;
+
+    public void addEnvVarInProfile( Profile profile, Installation envVar )
+        throws ProfileException;
+}

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/profile/ProfileService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Tue Jun 19 07:04:13 2007
@@ -19,20 +19,20 @@
  * under the License.
  */
 
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Profile;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.model.system.SystemConfiguration;
 
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -51,40 +51,42 @@
     Map getDefaultBuildDefinitions();
 
     /**
-     * returns the default build definition of the project, if the project doesn't have on declared the default
-     * of the project group will be returned
-     * <p/>
-     * this should be the most common usage of the default build definition accessing methods
-     *
+     * returns the default build definition of the project, if the project
+     * doesn't have on declared the default of the project group will be
+     * returned <p/> this should be the most common usage of the default build
+     * definition accessing methods
+     * 
      * @param projectId
      * @return
      * @throws ContinuumStoreException
      * @throws ContinuumObjectNotFoundException
-     *
+     * 
      */
     BuildDefinition getDefaultBuildDefinition( int projectId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
     /**
-     * returns the default build definition for the project without consulting the project group
-     *
+     * returns the default build definition for the project without consulting
+     * the project group
+     * 
      * @param projectId
      * @return
      * @throws ContinuumStoreException
      * @throws ContinuumObjectNotFoundException
-     *
+     * 
      */
     BuildDefinition getDefaultBuildDefinitionForProject( int projectId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
     /**
-     * returns the default build definition for the project group and there should always be one declared
-     *
+     * returns the default build definition for the project group and there
+     * should always be one declared
+     * 
      * @param projectGroupId
      * @return
      * @throws ContinuumStoreException
      * @throws ContinuumObjectNotFoundException
-     *
+     * 
      */
     BuildDefinition getDefaultBuildDefinitionForProjectGroup( int projectGroupId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
@@ -131,13 +133,39 @@
     Schedule storeSchedule( Schedule schedule )
         throws ContinuumStoreException;
 
+    // ----------------------------------------------------------------
+    // Profile
+    // ----------------------------------------------------------------    
     List getAllProfilesByName();
 
     Profile addProfile( Profile profile );
 
-    Installation addInstallation( Installation installation );
+    Installation addInstallation( Installation installation )
+        throws ContinuumStoreException;
+
+    Profile getProfile( int profileId )
+        throws ContinuumObjectNotFoundException, ContinuumStoreException;
+
+    void updateProfile( Profile profile )
+        throws ContinuumStoreException;
+
+    void removeProfile( Profile profile );
 
-    List getAllInstallations();
+    // ----------------------------------------------------------------
+    // Installation
+    // ----------------------------------------------------------------  
+
+    List getAllInstallations()
+        throws ContinuumStoreException;
+
+    void removeInstallation( Installation installation )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException;
+
+    void updateInstallation( Installation installation )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException;
+
+    Installation getInstallationByName( String installationName )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
     List getAllBuildsForAProjectByDate( int projectId );
 
@@ -162,17 +190,12 @@
     void updateProject( Project project )
         throws ContinuumStoreException;
 
-    void updateProfile( Profile profile )
-        throws ContinuumStoreException;
-
     void updateSchedule( Schedule schedule )
         throws ContinuumStoreException;
 
     Project getProjectWithBuilds( int projectId )
         throws ContinuumStoreException, ContinuumObjectNotFoundException;
 
-    void removeProfile( Profile profile );
-
     void removeSchedule( Schedule schedule );
 
     Project getProjectWithCheckoutResult( int projectId )
@@ -205,9 +228,6 @@
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
     Schedule getSchedule( int scheduleId )
-        throws ContinuumObjectNotFoundException, ContinuumStoreException;
-
-    Profile getProfile( int profileId )
         throws ContinuumObjectNotFoundException, ContinuumStoreException;
 
     ProjectGroup getProjectGroupByGroupId( String groupId )

Modified: maven/continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/pom.xml?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/pom.xml Tue Jun 19 07:04:13 2007
@@ -231,6 +231,16 @@
               <excludes>
                 <exclude>**/BuildProjectTaskExecutorTest.java</exclude>
               </excludes>
+              <systemProperties>
+                <property>
+                  <name>JAVA_HOME</name>
+                  <value>${JAVA_HOME}</value>    
+                </property>
+                <property>
+                  <name>M2_HOME</name>
+                  <value>${M2_HOME}</value>    
+                </property>                      
+              </systemProperties>
             </configuration>
           </plugin>
         </plugins>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Tue Jun 19 07:04:13 2007
@@ -33,6 +33,7 @@
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
 import org.apache.maven.continuum.initialization.ContinuumInitializer;
 import org.apache.maven.continuum.initialization.DefaultContinuumInitializer;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -40,6 +41,7 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.scm.ScmResult;
+import org.apache.maven.continuum.profile.ProfileService;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
@@ -120,6 +122,16 @@
      * @plexus.requirement
      */
     private SchedulesActivator schedulesActivator;
+    
+    /**
+     * @plexus.requirement
+     */
+    private InstallationService installationService;
+    
+    /**
+     * @plexus.requirement
+     */
+    private ProfileService profileService;
 
     // ----------------------------------------------------------------------
     // Moved from core
@@ -2765,6 +2777,16 @@
         {
             throw logAndCreateException( "Exception while getting default project group.", ex );
         }
+    }
+
+    public InstallationService getInstallationService()
+    {
+        return installationService;
+    }
+
+    public ProfileService getProfileService()
+    {
+        return profileService;
     }
 
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java Tue Jun 19 07:04:13 2007
@@ -177,6 +177,8 @@
                 }
 
                 storedDefinition.setSchedule( schedule );
+                
+                storedDefinition.setProfile( buildDefinition.getProfile() );
 
                 store.storeBuildDefinition( storedDefinition );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java Tue Jun 19 07:04:13 2007
@@ -19,9 +19,12 @@
  * under the License.
  */
 
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.scm.TestResult;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.continuum.utils.shell.ExecutionResult;
 import org.apache.maven.continuum.utils.shell.ShellCommandHelper;
@@ -34,9 +37,11 @@
 import org.codehaus.plexus.util.cli.CommandLineException;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Collections;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -66,6 +71,11 @@
     private WorkingDirectoryService workingDirectoryService;
 
     /**
+     * @plexus.requirement
+     */
+    private InstallationService installationService;
+
+    /**
      * @plexus.configuration
      */
     private String defaultExecutable;
@@ -102,8 +112,9 @@
         {
             if ( StringUtils.isEmpty( defaultExecutable ) )
             {
-                getLogger().warn( "The default executable for build executor '" + id + "' is not set. " +
-                    "This will cause a problem unless the project has a executable configured." );
+                getLogger().warn(
+                                  "The default executable for build executor '" + id + "' is not set. "
+                                      + "This will cause a problem unless the project has a executable configured." );
             }
             else
             {
@@ -112,12 +123,14 @@
                 if ( resolvedExecutable == null )
                 {
                     getLogger().warn(
-                        "Could not find the executable '" + defaultExecutable + "' in the " + "path '" + path + "'." );
+                                      "Could not find the executable '" + defaultExecutable + "' in the " + "path '"
+                                          + path + "'." );
                 }
                 else
                 {
-                    getLogger().info( "Resolved the executable '" + defaultExecutable + "' to " + "'" +
-                        resolvedExecutable.getAbsolutePath() + "'." );
+                    getLogger().info(
+                                      "Resolved the executable '" + defaultExecutable + "' to " + "'"
+                                          + resolvedExecutable.getAbsolutePath() + "'." );
                 }
             }
         }
@@ -128,7 +141,7 @@
     // ----------------------------------------------------------------------
 
     protected ContinuumBuildExecutionResult executeShellCommand( Project project, String executable, String arguments,
-                                                                 File output )
+                                                                 File output, Map<String, String> environments )
         throws ContinuumBuildExecutorException
     {
         // ----------------------------------------------------------------------
@@ -190,7 +203,8 @@
         try
         {
             ExecutionResult result = shellCommandHelper.executeShellCommand( workingDirectory, actualExecutable,
-                                                                             arguments, output, project.getId() );
+                                                                             arguments, output, project.getId(),
+                                                                             environments );
 
             getLogger().info( "Exit code: " + result.getExitCode() );
 
@@ -205,18 +219,55 @@
             else
             {
                 throw new ContinuumBuildExecutorException(
-                    "Error while executing shell command. The most common error is that '" + executable + "' "
-                        + "is not in your path.",
-                    e );
+                                                           "Error while executing shell command. The most common error is that '"
+                                                               + executable + "' " + "is not in your path.", e );
             }
         }
         catch ( Exception e )
         {
-            throw new ContinuumBuildExecutorException( "Error while executing shell command. " +
-                "The most common error is that '" + executable + "' " + "is not in your path.", e );
+            throw new ContinuumBuildExecutorException( "Error while executing shell command. "
+                + "The most common error is that '" + executable + "' " + "is not in your path.", e );
         }
     }
 
+    protected abstract Map<String, String> getEnvironments( BuildDefinition buildDefinition );
+
+    protected String getJavaHomeValue( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return null;
+        }
+        Installation jdk = profile.getJdk();
+        if ( jdk == null )
+        {
+            return null;
+        }
+        return jdk.getVarValue();
+    }
+
+    protected Map<String, String> getEnvironmentVariable( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        Map<String, String> envVars = new HashMap<String, String>();
+        if ( profile == null )
+        {
+            return envVars;
+        }
+        List<Installation> environmentVariables = profile.getEnvironmentVariables();
+        if ( environmentVariables.isEmpty() )
+        {
+            return envVars;
+        }
+        for ( Iterator<Installation> iterator = environmentVariables.iterator(); iterator.hasNext(); )
+        {
+            Installation installation = iterator.next();
+            envVars.put( installation.getVarName(), installation.getVarValue() );
+        }
+        return envVars;
+    }
+
     public boolean isBuilding( Project project )
     {
         return shellCommandHelper.isRunning( project.getId() );
@@ -239,8 +290,19 @@
         return workingDirectoryService.getWorkingDirectory( project );
     }
 
-    public TestResult getTestResults(Project project)
-            throws ContinuumBuildExecutorException {
+    public TestResult getTestResults( Project project )
+        throws ContinuumBuildExecutorException
+    {
         return null;
+    }
+
+    public InstallationService getInstallationService()
+    {
+        return installationService;
+    }
+
+    public void setInstallationService( InstallationService installationService )
+    {
+        this.installationService = installationService;
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java Tue Jun 19 07:04:13 2007
@@ -23,11 +23,17 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -66,19 +72,43 @@
         // TODO: get from installation
 //        String executable = project.getExecutable();
         String executable = "ant";
-        
+
         String arguments = "";
-        
+
         String buildFile = buildDefinition.getBuildFile();
 
-        if (!StringUtils.isEmpty(buildFile)) {
+        if ( !StringUtils.isEmpty( buildFile ) )
+        {
             arguments = "-f " + buildFile + " ";
         }
 
-        arguments += StringUtils.clean( buildDefinition.getArguments() ) + " " +
-            StringUtils.clean( buildDefinition.getGoals() );
+        arguments += StringUtils.clean( buildDefinition.getArguments() ) + " "
+            + StringUtils.clean( buildDefinition.getGoals() );
+
+        return executeShellCommand( project, executable, arguments, buildOutput, getEnvironments( buildDefinition ) );
+    }
+
+    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+        Map<String, String> envVars = new HashMap<String, String>();
+        String javaHome = getJavaHomeValue( buildDefinition );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
+        }
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.ANT_TYPE ), builder.getVarValue() );
+        }
+        envVars.putAll( getEnvironmentVariable( buildDefinition ) );
+        return envVars;
 
-        return executeShellCommand( project, executable, arguments, buildOutput );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, Project p, BuildDefinition buildDefinition )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java Tue Jun 19 07:04:13 2007
@@ -23,11 +23,17 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -78,9 +84,32 @@
         arguments += StringUtils.clean( buildDefinition.getArguments() ) + " " +
             StringUtils.clean( buildDefinition.getGoals() );
 
-        return executeShellCommand( project, executable, arguments, buildOutput );
+        return executeShellCommand( project, executable, arguments, buildOutput, getEnvironments( buildDefinition ) );
     }
 
+    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+        Map<String, String> envVars = new HashMap<String, String>();
+        String javaHome = getJavaHomeValue( buildDefinition );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
+        }
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN1_TYPE ), builder.getVarValue() );
+        }
+        envVars.putAll( getEnvironmentVariable( buildDefinition ) );
+        return envVars;
+
+    }
+    
     public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
         throws ContinuumBuildExecutorException
     {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java Tue Jun 19 07:04:13 2007
@@ -19,17 +19,31 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.SuiteResult;
 import org.apache.maven.continuum.model.scm.TestCaseFailure;
 import org.apache.maven.continuum.model.scm.TestResult;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
@@ -40,14 +54,6 @@
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -107,10 +113,12 @@
             arguments = "-f " + buildFile + " ";
         }
 
-        arguments +=
-            StringUtils.clean( buildDefinition.getArguments() ) + " " + StringUtils.clean( buildDefinition.getGoals() );
+        arguments += StringUtils.clean( buildDefinition.getArguments() ) + " "
+            + StringUtils.clean( buildDefinition.getGoals() );
+        Map<String, String> environments = new HashMap<String, String>();
+        Profile profile = buildDefinition.getProfile();
 
-        return executeShellCommand( project, executable, arguments, buildOutput );
+        return executeShellCommand( project, executable, arguments, buildOutput, getEnvironments( buildDefinition ) );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
@@ -173,8 +181,8 @@
 
         if ( result.hasErrors() )
         {
-            throw new ContinuumBuildExecutorException(
-                "Unable to read the Maven project descriptor '" + f + "': " + result.getErrorsAsString() );
+            throw new ContinuumBuildExecutorException( "Unable to read the Maven project descriptor '" + f + "': "
+                + result.getErrorsAsString() );
         }
 
         // Maven could help us out a lot more here by knowing how to get the deployment artifacts from a project.
@@ -277,8 +285,9 @@
     {
         DirectoryScanner scanner = new DirectoryScanner();
         scanner.setBasedir( workingDir );
-        scanner.setIncludes(
-            new String[]{"**/target/surefire-reports/TEST-*.xml", "**/target/surefire-it-reports/TEST-*.xml"} );
+        scanner.setIncludes( new String[] {
+            "**/target/surefire-reports/TEST-*.xml",
+            "**/target/surefire-it-reports/TEST-*.xml" } );
         scanner.scan();
 
         TestResult testResult = new TestResult();
@@ -301,8 +310,8 @@
 
                 suite.setName( parser.getAttributeValue( null, "name" ) );
 
-                int suiteFailureCount = Integer.parseInt( parser.getAttributeValue( null, "errors" ) ) +
-                    Integer.parseInt( parser.getAttributeValue( null, "failures" ) );
+                int suiteFailureCount = Integer.parseInt( parser.getAttributeValue( null, "errors" ) )
+                    + Integer.parseInt( parser.getAttributeValue( null, "failures" ) );
 
                 long suiteTotalTime = (long) ( 1000 * Double.parseDouble( parser.getAttributeValue( null, "time" ) ) );
 
@@ -319,10 +328,10 @@
                         {
                             parser.next();
                         }
-                        while ( parser.getEventType() != XmlPullParser.START_TAG &&
-                            parser.getEventType() != XmlPullParser.END_TAG );
-                        if ( parser.getEventType() == XmlPullParser.START_TAG &&
-                            ( "error".equals( parser.getName() ) || "failure".equals( parser.getName() ) ) )
+                        while ( parser.getEventType() != XmlPullParser.START_TAG
+                            && parser.getEventType() != XmlPullParser.END_TAG );
+                        if ( parser.getEventType() == XmlPullParser.START_TAG
+                            && ( "error".equals( parser.getName() ) || "failure".equals( parser.getName() ) ) )
                         {
                             TestCaseFailure failure = new TestCaseFailure();
                             failure.setName( name );
@@ -363,5 +372,28 @@
         testResult.setTotalTime( totalTime );
 
         return testResult;
+    }
+
+    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+        Map<String, String> envVars = new HashMap<String, String>();
+        String javaHome = getJavaHomeValue( buildDefinition );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
+        }
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN2_TYPE ), builder.getVarValue() );
+        }
+        envVars.putAll( getEnvironmentVariable( buildDefinition ) );
+        return envVars;
+
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java Tue Jun 19 07:04:13 2007
@@ -19,14 +19,20 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
-
-import java.io.File;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -64,7 +70,31 @@
         // TODO: this should be validated earlier?
         String executable = buildDefinition.getBuildFile();
 
-        return executeShellCommand( project, executable, buildDefinition.getArguments(), buildOutput );
+        return executeShellCommand( project, executable, buildDefinition.getArguments(), buildOutput,
+                                    getEnvironments( buildDefinition ) );
+    }
+
+    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
+    {
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+        Map<String, String> envVars = new HashMap<String, String>();
+        String javaHome = getJavaHomeValue( buildDefinition );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            // TODO what todo with this ?
+        }
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            // TODO what todo with this ?
+        }
+        envVars.putAll( getEnvironmentVariable( buildDefinition ) );
+        return envVars;
+
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,279 @@
+package org.apache.maven.continuum.installation;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 13 juin 07
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.continuum.installation.InstallationService"
+ * TODO use some cache mechanism to prevent always reading from store ?
+ */
+public class DefaultInstallationService
+    implements InstallationService, Initializable
+{
+
+    /**
+     * @plexus.requirement role-hint="jdo"
+     */
+    private ContinuumStore store;
+
+    private Map<String, String> typesValues;
+
+    // ---------------------------------------------
+    // Plexus lifecycle
+    // ---------------------------------------------
+
+    public void initialize()
+        throws InitializationException
+    {
+        // TODO move this in a component configuration 
+        this.typesValues = new HashMap<String, String>();
+        this.typesValues.put( InstallationService.ANT_TYPE, "ANT_HOME" );
+        this.typesValues.put( InstallationService.ENVVAR_TYPE, null );
+        this.typesValues.put( InstallationService.JDK_TYPE, "JAVA_HOME" );
+        this.typesValues.put( InstallationService.MAVEN1_TYPE, "MAVEN_HOME" );
+        this.typesValues.put( InstallationService.MAVEN2_TYPE, "M2_HOME" );
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#add(org.apache.maven.continuum.model.system.Installation)
+     */
+    public Installation add( Installation installation )
+        throws InstallationException
+    {
+        try
+        {
+            String envVarName = this.typesValues.get( installation.getType() );
+            // override with the defined var name for defined types
+            if ( StringUtils.isNotEmpty( envVarName ) )
+            {
+                installation.setVarName( envVarName );
+            }
+            return store.addInstallation( installation );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#delete(org.apache.maven.continuum.model.system.Installation)
+     */
+    public void delete( Installation installation )
+        throws InstallationException
+    {
+        // TODO remove the installations attached to profiles : jdo failed
+        try
+        {
+            store.removeInstallation( installation );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#getAllInstallations()
+     */
+    public List<Installation> getAllInstallations()
+        throws InstallationException
+    {
+        try
+        {
+            List installations = store.getAllInstallations();
+            return installations == null ? Collections.EMPTY_LIST : installations;
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#getInstallation(java.lang.String)
+     */
+    public Installation getInstallation( String name )
+        throws InstallationException
+    {
+        try
+        {
+            return store.getInstallationByName( name );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#update(org.apache.maven.continuum.model.system.Installation)
+     */
+    public void update( Installation installation )
+        throws InstallationException
+    {
+        try
+        {
+            Installation stored = getInstallation( installation.getName() );
+            if ( stored == null )
+            {
+                throw new InstallationException( "installation with name " + installation.getName() + " not exists" );
+            }
+
+            stored.setName( installation.getName() );
+            stored.setType( installation.getType() );
+            String envVarName = this.typesValues.get( installation.getType() );
+            // override with the defined var name for defined types
+            if ( StringUtils.isNotEmpty( envVarName ) )
+            {
+                installation.setVarName( envVarName );
+            }
+            else
+            {
+                stored.setVarName( installation.getVarName() );
+            }
+            stored.setVarValue( installation.getVarValue() );
+            store.updateInstallation( stored );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#getTypeEnvVar(java.lang.String)
+     */
+    public String getEnvVar( String type )
+    {
+        return (String) this.typesValues.get( type );
+    }
+
+    // -------------------------------------------------------------
+    // versions informations on jdk and builders (mvn, maven, ant )
+    // -------------------------------------------------------------
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#getDefaultJdkInformations()
+     */
+    public List<String> getDefaultJdkInformations()
+        throws InstallationException
+    {
+        try
+        {
+            Properties systemEnvVars = CommandLineUtils.getSystemEnvVars( false );
+
+            String javaHome = (String) systemEnvVars.get( "JAVA_HOME" );
+            return getJavaHomeInformations( javaHome );
+        }
+        catch ( IOException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+        catch ( CommandLineException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.installation.InstallationService#getJdkInformations(org.apache.maven.continuum.model.system.Installation)
+     */
+    public List<String> getJdkInformations( Installation installation )
+        throws InstallationException
+    {
+        if ( StringUtils.isEmpty( installation.getVarValue() ) )
+        {
+            return getDefaultJdkInformations();
+        }
+        try
+        {
+            return getJavaHomeInformations( installation.getVarValue() );
+        }
+        catch ( CommandLineException e )
+        {
+            throw new InstallationException( e.getMessage(), e );
+        }
+    }
+
+    private List<String> getJavaHomeInformations( String javaHome )
+        throws CommandLineException
+    {
+        Commandline commandline = new Commandline();
+
+        String executable = javaHome + File.separator + "bin" + File.separator + "java";
+        /*
+        if ( Os.isFamily( Os.FAMILY_DOS ) )
+        {
+            executable = "%JAVA_HOME%\\bin\\java";
+        }
+        else
+        {
+            executable = "$JAVA_HOME/bin/java";
+        }
+        */
+        commandline.setExecutable( executable );
+        commandline.addArguments( new String[] { "-version" } );
+        final List<String> cliOutput = new ArrayList<String>();
+        //TODO ShellCommandHelper ?
+        int result = CommandLineUtils.executeCommandLine( commandline, new StreamConsumer()
+        {
+            public void consumeLine( String line )
+            {
+                cliOutput.add( line );
+            }
+        }, new StreamConsumer()
+        {
+            public void consumeLine( String line )
+            {
+                cliOutput.add( line );
+            }
+        } );
+        if ( result != 0 )
+        {
+            throw new CommandLineException( "cli to get JAVA_HOME informations return code " + result );
+        }
+        return cliOutput;
+    }
+}

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/installation/DefaultInstallationService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Tue Jun 19 07:04:13 2007
@@ -19,11 +19,23 @@
  * under the License.
  */
 
+import java.io.StringWriter;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.configuration.ConfigurationService;
+import org.apache.maven.continuum.installation.InstallationException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.notification.AbstractContinuumNotifier;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.notification.ContinuumRecipientSource;
@@ -40,15 +52,6 @@
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
-import java.io.StringWriter;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @version $Id$
@@ -86,10 +89,13 @@
      */
     private MailSender mailSender;
 
+    /**
+     * @plexus.requirement role-hint="default"
+     */
+    //private ShellCommandHelper shellCommandHelper;
     // ----------------------------------------------------------------------
     // Configuration
     // ----------------------------------------------------------------------
-
     /**
      * @plexus.configuration
      */
@@ -186,13 +192,16 @@
     {
         Project project = (Project) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT );
 
-        ProjectNotifier projectNotifier =
-            (ProjectNotifier) context.get( ContinuumNotificationDispatcher.CONTEXT_PROJECT_NOTIFIER );
+        ProjectNotifier projectNotifier = (ProjectNotifier) context
+            .get( ContinuumNotificationDispatcher.CONTEXT_PROJECT_NOTIFIER );
 
         BuildResult build = (BuildResult) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD );
 
         String buildOutput = (String) context.get( ContinuumNotificationDispatcher.CONTEXT_BUILD_OUTPUT );
 
+        BuildDefinition buildDefinition = (BuildDefinition) context
+            .get( ContinuumNotificationDispatcher.CONTEXT_BUILD_DEFINITION );
+
         // ----------------------------------------------------------------------
         // If there wasn't any building done, don't notify
         // ----------------------------------------------------------------------
@@ -208,14 +217,17 @@
 
         if ( source.equals( ContinuumNotificationDispatcher.MESSAGE_ID_BUILD_COMPLETE ) )
         {
-            buildComplete( project, projectNotifier, build, buildOutput, source, recipients, configuration );
+            buildComplete( project, projectNotifier, build, buildOutput, source, recipients, configuration,
+                           buildDefinition );
         }
     }
 
-    private void buildComplete( Project project, ProjectNotifier projectNotifier, BuildResult build, String buildOutput,
-                                String source, Set recipients, Map configuration )
+    private void buildComplete( Project project, ProjectNotifier projectNotifier, BuildResult build,
+                                String buildOutput, String source, Set recipients, Map configuration,
+                                BuildDefinition buildDefinition )
         throws NotificationException
     {
+
         // ----------------------------------------------------------------------
         // Check if the mail should be sent at all
         // ----------------------------------------------------------------------
@@ -255,8 +267,8 @@
 
                 context.put( "build", build );
 
-                context.put( "changesSinceLastSuccess",
-                             continuum.getChangesSinceLastSuccess( project.getId(), build.getId() ) );
+                context.put( "changesSinceLastSuccess", continuum.getChangesSinceLastSuccess( project.getId(), build
+                    .getId() ) );
 
                 context.put( "buildOutput", buildOutput );
 
@@ -283,8 +295,13 @@
 
                 context.put( "osName", osName );
 
-                context.put( "javaVersion",
-                             System.getProperty( "java.version" ) + "(" + System.getProperty( "java.vendor" ) + ")" );
+                context.put( "javaVersion", System.getProperty( "java.version" ) + "("
+                    + System.getProperty( "java.vendor" ) + ")" );
+
+                // TODO only in case of a java project ?
+                context.put( "javaHomeInformations", getJavaHomeInformations( buildDefinition ) );
+                
+                // TODO add other informations on profile : builder version other envVars used
 
                 // ----------------------------------------------------------------------
                 // Generate
@@ -323,6 +340,21 @@
     //
     // ----------------------------------------------------------------------
 
+    private List<String> getJavaHomeInformations( BuildDefinition buildDefinition )
+        throws InstallationException
+    {
+        if ( buildDefinition == null )
+        {
+            return continuum.getInstallationService().getDefaultJdkInformations();
+        }
+        Profile profile = buildDefinition.getProfile();
+        if ( profile == null )
+        {
+            return continuum.getInstallationService().getDefaultJdkInformations();
+        }
+        return continuum.getInstallationService().getJdkInformations( profile.getJdk() );
+    }
+
     private String generateSubject( Project project, BuildResult build )
     {
         int state = project.getState();
@@ -370,8 +402,9 @@
         if ( fromMailbox == null )
         {
             getLogger()
-                .warn( project.getName() +
-                    ": Project is missing nag email and global from mailbox is missing, not sending mail." );
+                .warn(
+                       project.getName()
+                           + ": Project is missing nag email and global from mailbox is missing, not sending mail." );
 
             return;
         }
@@ -464,8 +497,8 @@
 
         if ( currentBuild != null && build.getId() != currentBuild.getId() )
         {
-            throw new NotificationException( "INTERNAL ERROR: The current build wasn't the first in the build list. " +
-                "Current build: '" + currentBuild.getId() + "', " + "first build: '" + build.getId() + "'." );
+            throw new NotificationException( "INTERNAL ERROR: The current build wasn't the first in the build list. "
+                + "Current build: '" + currentBuild.getId() + "', " + "first build: '" + build.getId() + "'." );
         }
 
         return (BuildResult) builds.get( builds.size() - 2 );

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java?view=auto&rev=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java (added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java Tue Jun 19 07:04:13 2007
@@ -0,0 +1,176 @@
+package org.apache.maven.continuum.profile;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+
+/**
+ * @author <a href="mailto:olamy@codehaus.org">olamy</a>
+ * @since 15 juin 07
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.continuum.profile.ProfileService"
+ * TODO use some cache mechanism to prevent always reading from store ?
+ */
+public class DefaultProfileService
+    implements ProfileService
+{
+
+    /**
+     * @plexus.requirement role-hint="jdo"
+     */
+    private ContinuumStore store;
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#updateProfile(org.apache.maven.continuum.model.system.Profile)
+     */
+    public void updateProfile( Profile profile )
+        throws ProfileException
+    {
+        try
+        {
+            Profile stored = getProfile( profile.getId() );
+            stored.setActive( profile.isActive() );
+            stored.setBuilder( profile.getBuilder() );
+            stored.setBuildWithoutChanges( profile.isBuildWithoutChanges() );
+            stored.setDescription( profile.getDescription() );
+            stored.setJdk( profile.getJdk() );
+            stored.setName( profile.getName() );
+            stored.setEnvironmentVariables( profile.getEnvironmentVariables() );
+            store.updateProfile( stored );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ProfileException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#addProfile(org.apache.maven.continuum.model.system.Profile)
+     */
+    public Profile addProfile( Profile profile )
+        throws ProfileException
+    {
+        // TODO check if one with the same name already here
+        profile.setBuilder( null );
+        profile.setJdk( null );
+        profile.setEnvironmentVariables( null );
+        return store.addProfile( profile );
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#deletedProfile(int)
+     */
+    public void deleteProfile( int profileId )
+        throws ProfileException
+    {
+        store.removeProfile( getProfile( profileId ) );
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#getAllProfiles()
+     */
+    public List<Profile> getAllProfiles()
+        throws ProfileException
+    {
+        return store.getAllProfilesByName();
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#getProfile(int)
+     */
+    public Profile getProfile( int profileId )
+        throws ProfileException
+    {
+        try
+        {
+            return store.getProfile( profileId );
+        }
+        catch ( ContinuumObjectNotFoundException e )
+        {
+            // really ignore ?
+            return null;
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ProfileException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#setBuilderInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)
+     */
+    public void setBuilderInProfile( Profile profile, Installation builder )
+        throws ProfileException
+    {
+        Profile stored = getProfile( profile.getId() );
+        stored.setBuilder( builder );
+        try
+        {
+            store.updateProfile( stored );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ProfileException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#setJdkInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)
+     */
+    public void setJdkInProfile( Profile profile, Installation jdk )
+        throws ProfileException
+    {
+        Profile stored = getProfile( profile.getId() );
+        stored.setJdk( jdk );
+        try
+        {
+            store.updateProfile( stored );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ProfileException( e.getMessage(), e );
+        }
+    }
+
+    /** 
+     * @see org.apache.maven.continuum.profile.ProfileService#addEnvVarInProfile(org.apache.maven.continuum.model.system.Profile, org.apache.maven.continuum.model.system.Installation)
+     */
+    public void addEnvVarInProfile( Profile profile, Installation envVar )
+        throws ProfileException
+    {
+        Profile stored = getProfile( profile.getId() );
+        stored.addEnvironmentVariable( envVar );
+        try
+        {
+            store.updateProfile( stored );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new ProfileException( e.getMessage(), e );
+        }
+    }
+
+}

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java Tue Jun 19 07:04:13 2007
@@ -28,6 +28,9 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.Writer;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -45,8 +48,8 @@
     // ShellCommandHelper Implementation
     // ----------------------------------------------------------------------
 
-    public ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments, File output,
-                                                long idCommand )
+    public ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments,
+                                                File output, long idCommand, Map<String, String> environments )
         throws Exception
     {
         Commandline cl = new Commandline();
@@ -55,11 +58,11 @@
 
         argument.setLine( arguments );
 
-        return executeShellCommand( workingDirectory, executable, argument.getParts(), output, idCommand );
+        return executeShellCommand( workingDirectory, executable, argument.getParts(), output, idCommand, environments );
     }
 
     public ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments,
-                                                File output, long idCommand )
+                                                File output, long idCommand, Map<String, String> environments )
         throws Exception
     {
         // ----------------------------------------------------------------------
@@ -70,10 +73,22 @@
 
         cl.setPid( idCommand );
 
-        cl.addSystemEnvironment();
+        
 
         cl.addEnvironment( "MAVEN_TERMINATE_CMD", "on" );
 
+        if ( environments != null && !environments.isEmpty() )
+        {
+            for ( Iterator<String> iterator = environments.keySet().iterator(); iterator.hasNext(); )
+            {
+                String key = iterator.next();
+                String value = environments.get( key );
+                cl.addEnvironment( key, value );
+            }
+        }
+
+        cl.addSystemEnvironment();
+        
         cl.setExecutable( executable );
 
         cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );
@@ -87,6 +102,7 @@
 
         getLogger().info( "Executing: " + cl );
         getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
+        getLogger().debug( "EnvironmentVariables " + Arrays.asList( cl.getEnvironmentVariables() ) );
 
         // ----------------------------------------------------------------------
         //

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java Tue Jun 19 07:04:13 2007
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -30,11 +31,11 @@
     String ROLE = ShellCommandHelper.class.getName();
 
     ExecutionResult executeShellCommand( File workingDirectory, String executable, String arguments, File output,
-                                         long idCommand )
+                                         long idCommand, Map<String, String> environments )
         throws Exception;
 
     ExecutionResult executeShellCommand( File workingDirectory, String executable, String[] arguments, File output,
-                                         long idCommand )
+                                         long idCommand, Map<String, String> environments )
         throws Exception;
 
     boolean isRunning( long idCommand );

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml Tue Jun 19 07:04:13 2007
@@ -100,6 +100,9 @@
         <requirement>
           <role>org.apache.maven.project.MavenProjectHelper</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.installation.InstallationService</role>  
+        </requirement>
       </requirements>
     </component>
 
@@ -124,6 +127,9 @@
         <requirement>
           <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.installation.InstallationService</role>  
+        </requirement>          
       </requirements>
     </component>
 
@@ -142,6 +148,9 @@
         <requirement>
           <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.installation.InstallationService</role>  
+        </requirement>          
       </requirements>
       <configuration>
         <default-executable>ant</default-executable>
@@ -162,6 +171,9 @@
         <requirement>
           <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.installation.InstallationService</role>  
+        </requirement>          
       </requirements>
     </component>
 

Modified: maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm?view=diff&rev=548732&r1=548731&r2=548732
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm (original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm Tue Jun 19 07:04:13 2007
@@ -30,7 +30,10 @@
   Exit code: $build.exitCode
   Building machine hostname: $buildHost
   Operating system : $osName
-  Java version : $javaVersion
+  Java Home version : 
+    #foreach ( $javaHomeInformation in $javaHomeInformations )
+      $javaHomeInformation
+    #end     
 
 #if ( $build.scmResult )
 ****************************************************************************



Mime
View raw message