svn commit: r690929 - in /activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven: DotMojo.java EmbeddedMojo.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r690929 - in /activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven: DotMojo.java EmbeddedMojo.java

davsclaus-2
Author: davsclaus
Date: Mon Sep  1 02:51:04 2008
New Revision: 690929

URL: http://svn.apache.org/viewvc?rev=690929&view=rev
Log:
CAMEL-851: camel:dot now also supports configuration of where the spring xml files is located (applicationContextUri, fileApplicationContextUri)

Modified:
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java?rev=690929&r1=690928&r2=690929&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java (original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java Mon Sep  1 02:51:04 2008
@@ -116,6 +116,20 @@
     private File outputDirectory;
 
     /**
+     * The classpath based application context uri that spring wants to get.
+     *
+     * @parameter expression="${camel.applicationContextUri}"
+     */
+    protected String applicationContextUri;
+
+    /**
+     * The filesystem based application context uri that spring wants to get.
+     *
+     * @parameter expression="${camel.fileApplicationContextUri}"
+     */
+    protected String fileApplicationContextUri;
+
+    /**
      * In the case of multiple camel contexts, setting aggregate == true will
      * aggregate all into a monolithic context, otherwise they will be processed
      * independently.
@@ -327,7 +341,14 @@
 
     protected void runCamelEmbedded(File outputDir) throws DependencyResolutionRequiredException {
         if (runCamel) {
-            getLog().info("Running Camel embedded to load META-INF/spring/*.xml files");
+            // default path, but can be overridden by configuration
+            if (applicationContextUri != null) {
+                getLog().info("Running Camel embedded to load Spring XML files from classpath: " + applicationContextUri);
+            } else if (fileApplicationContextUri != null) {
+                getLog().info("Running Camel embedded to load Spring XML files from file path: " + fileApplicationContextUri);
+            } else {
+                getLog().info("Running Camel embedded to load Spring XML files from default path: META-INF/spring/*.xml");
+            }
 
             List list = project.getTestClasspathElements();
             getLog().debug("Using classpath: " + list);
@@ -336,13 +357,14 @@
             mojo.setClasspathElements(list);
             mojo.setDotEnabled(true);
             if ("true".equals(getAggregate())) {
-
                 mojo.setDotAggregationEnabled(true);
             }
             mojo.setOutputDirectory(outputDirectory.getAbsolutePath());
             mojo.setDuration(duration);
             mojo.setLog(getLog());
             mojo.setPluginContext(getPluginContext());
+            mojo.setApplicationContextUri(applicationContextUri);
+            mojo.setFileApplicationContextUri(fileApplicationContextUri);
             try {
                 mojo.executeWithoutWrapping();
             } catch (Exception e) {

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java?rev=690929&r1=690928&r2=690929&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java (original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java Mon Sep  1 02:51:04 2008
@@ -174,6 +174,22 @@
         this.dotAggregationEnabled = dotAggregationEnabled;
     }
 
+    public String getApplicationContextUri() {
+        return applicationContextUri;
+    }
+
+    public void setApplicationContextUri(String applicationContextUri) {
+        this.applicationContextUri = applicationContextUri;
+    }
+
+    public String getFileApplicationContextUri() {
+        return fileApplicationContextUri;
+    }
+
+    public void setFileApplicationContextUri(String fileApplicationContextUri) {
+        this.fileApplicationContextUri = fileApplicationContextUri;
+    }
+
     // Implementation methods
     //-------------------------------------------------------------------------