geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396140 - in /geronimo/branches/1.1: etc/project.properties plugins/geronimo-packaging-plugin/project.xml plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Date Sat, 22 Apr 2006 16:26:40 GMT
Author: ammulder
Date: Sat Apr 22 09:26:32 2006
New Revision: 396140

URL: http://svn.apache.org/viewcvs?rev=396140&view=rev
Log:
Fix problem in packaging plugin where it stopped configuring the
  output directory correctly after the first CAR it built
Update packaging plugin version to -6

Modified:
    geronimo/branches/1.1/etc/project.properties
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java

Modified: geronimo/branches/1.1/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/etc/project.properties?rev=396140&r1=396139&r2=396140&view=diff
==============================================================================
--- geronimo/branches/1.1/etc/project.properties (original)
+++ geronimo/branches/1.1/etc/project.properties Sat Apr 22 09:26:32 2006
@@ -95,7 +95,7 @@
 tranql_vendors_version=1.1
 release_notes_version=1.0
 
-geronimo_packaging_plugin_version=1.1.0-5
+geronimo_packaging_plugin_version=1.1.0-6
 geronimo_assembly_plugin_version=1.1.0-10
 geronimo_deployment_plugin_version=1.1.0-2
 geronimo_dependency_plugin_version=1.1.0-2

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml?rev=396140&r1=396139&r2=396140&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml (original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/project.xml Sat Apr 22 09:26:32
2006
@@ -22,7 +22,7 @@
     <groupId>geronimo</groupId>
     <id>geronimo-packaging-plugin</id>
     <name>Geronimo :: Maven Packaging Plugin</name>
-    <currentVersion>1.1.0-5</currentVersion>
+    <currentVersion>1.1.0-6</currentVersion>
 
     <dependencies>
         <dependency>

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=396140&r1=396139&r2=396140&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Sat Apr 22 09:26:32 2006
@@ -35,6 +35,7 @@
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
@@ -61,6 +62,8 @@
      * The KernelRegistry keeps soft references that may be garbage collected.
      */
     private static Kernel kernel;
+    private static AbstractName targetConfigStoreAName;
+    private static AbstractName targetRepositoryAName;
 
     private static final String[] ARG_TYPES = {
             boolean.class.getName(),
@@ -95,7 +98,7 @@
     private String extensionDirs;
     private String explicitResolutionLocation;
 
-    private String targetConfigStore;
+    private boolean targetSet;
 
     public String getRepositoryClass() {
         return repositoryClass;
@@ -268,6 +271,9 @@
         System.out.println();
         try {
             Kernel kernel = createKernel();
+            if(!targetSet) {
+                setTargetConfigStore();
+            }
 
             // start the Configuration we're going to use for this deployment
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
@@ -285,7 +291,7 @@
             }
 
             AbstractName deployer = locateDeployer(kernel);
-            invokeDeployer(kernel, deployer, targetConfigStore);
+            invokeDeployer(kernel, deployer, targetConfigStoreAName.toString());
             System.out.println("Generated package " + packageFile);
         } catch (Exception e) {
             log.error(e.getClass().getName() + ": " + e.getMessage(), e);
@@ -293,6 +299,21 @@
         }
     }
 
+    private void setTargetConfigStore() throws Exception {
+        try {
+            kernel.stopGBean(targetRepositoryAName);
+            kernel.setAttribute(targetRepositoryAName, "root", targetRepository.toURI());
+            kernel.startGBean(targetRepositoryAName);
+            if(kernel.getGBeanState(targetConfigStoreAName) != State.RUNNING_INDEX) {
+                throw new IllegalStateException("After restarted repository then config store
is not running");
+            }
+            targetSet = true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw e;
+        }
+    }
+
     /**
      * Create a Geronimo Kernel to contain the deployment configurations.
      */
@@ -341,6 +362,7 @@
         URI targetRepositoryURI = targetRepository.toURI();
         targetRepoGBean.setAttribute("root", targetRepositoryURI);
         repoNames.add(targetRepoGBean.getAbstractName());
+        targetRepositoryAName = targetRepoGBean.getAbstractName();
 
         GBeanData artifactManagerGBean = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
 
@@ -367,7 +389,8 @@
         }
         storeNames.add(targetStoreGBean.getAbstractName());
 
-        targetConfigStore = targetStoreGBean.getAbstractName().toString();
+        targetConfigStoreAName = targetStoreGBean.getAbstractName();
+        targetSet = true;
 
         GBeanData attrManagerGBean = bootstrap.addGBean("AttributeStore", MavenAttributeStore.GBEAN_INFO);
 



Mime
View raw message