Author: davsclaus Date: Fri Mar 4 06:41:07 2011 New Revision: 1077827 URL: http://svn.apache.org/viewvc?rev=1077827&view=rev Log: CAMEL-3568: Migrated webconsole archetype to the new maven style.
Added: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml (with props) camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties (with props) Removed: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype.xml Modified: camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/src/main/resources/log4j.properties camel/trunk/tooling/archetypes/camel-archetype-webconsole/pom.xml camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/pom.xml camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml Modified: camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/src/main/resources/log4j.properties URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/src/main/resources/log4j.properties?rev=1077827&r1=1077826&r2=1077827&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/src/main/resources/log4j.properties (original) +++ camel/trunk/tooling/archetypes/camel-archetype-activemq/src/main/resources/archetype-resources/src/main/resources/log4j.properties Fri Mar 4 06:41:07 2011 @@ -16,7 +16,7 @@ ## ------------------------------------------------------------------------ # -# The logging properties used for eclipse testing, We want to see debug output on the console. +# The logging properties used # log4j.rootLogger=INFO, out Modified: camel/trunk/tooling/archetypes/camel-archetype-webconsole/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/pom.xml?rev=1077827&r1=1077826&r2=1077827&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-webconsole/pom.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/pom.xml Fri Mar 4 06:41:07 2011 @@ -41,29 +41,19 @@ <artifactId>archetype-packaging</artifactId> </extension> </extensions> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <phase>process-resources</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <tasks> - <replace file="${project.build.directory}/classes/archetype-resources/pom.xml" token="$CAMEL_VERSION_REPLACEME$" value="${project.version}" casesensitive="true" /> - <replace file="${project.build.directory}/classes/archetype-resources/pom.xml" token="$ACTIVEMQ_VERSION_REPLACEME$" value="${activemq-version}" casesensitive="true" /> - <replace file="${project.build.directory}/classes/archetype-resources/pom.xml" token="$JETTY_VERSION_REPLACEME$" value="${jetty-version}" casesensitive="true" /> - <replace file="${project.build.directory}/classes/archetype-resources/pom.xml" token="$XBEAN_VERSION_REPLACEME$" value="${xbean-spring-version}" casesensitive="true" /> - <replace file="${project.build.directory}/classes/archetype-resources/pom.xml" token="$MAVEN_COMPILER_PLUGIN_VERSION_REPLACEME$" value="${maven-compiler-plugin-version}" casesensitive="true" /> - </tasks> - </configuration> - </execution> - </executions> - </plugin> - </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>false</filtering> + </resource> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + <includes> + <include>**/archetype-metadata.xml</include> + </includes> + </resource> + </resources> </build> </project> Added: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml?rev=1077827&view=auto ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml (added) +++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml Fri Mar 4 06:41:07 2011 @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="camel-archetype-java" + xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <requiredProperties> + <requiredProperty key="activemq-version"> + <defaultValue>${activemq-version}</defaultValue> + </requiredProperty> + <requiredProperty key="camel-version"> + <defaultValue>${project.version}</defaultValue> + </requiredProperty> + <requiredProperty key="geronimo-jms-spec-version"> + <defaultValue>${geronimo-jms-spec-version}</defaultValue> + </requiredProperty> + <requiredProperty key="log4j-version"> + <defaultValue>${log4j-version}</defaultValue> + </requiredProperty> + <requiredProperty key="jetty-version"> + <defaultValue>${jetty-version}</defaultValue> + </requiredProperty> + <requiredProperty key="maven-compiler-plugin-version"> + <defaultValue>${maven-compiler-plugin-version}</defaultValue> + </requiredProperty> + <requiredProperty key="slf4j-version"> + <defaultValue>${slf4j-version}</defaultValue> + </requiredProperty> + <requiredProperty key="spring-version"> + <defaultValue>${spring-version}</defaultValue> + </requiredProperty> + <requiredProperty key="xbean-spring-version"> + <defaultValue>${xbean-spring-version}</defaultValue> + </requiredProperty> + </requiredProperties> + <fileSets> + <fileSet filtered="true" packaged="true" encoding="UTF-8"> + <directory>src/main/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> + <fileSet filtered="true" encoding="UTF-8"> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + <fileSet filtered="true" encoding="UTF-8"> + <directory>src/main/webapp</directory> + <includes> + <include>**/*</include> + </includes> + </fileSet> + <fileSet encoding="UTF-8"> + <directory>src/data</directory> + <includes> + <include>**/*.xml</include> + </includes> + </fileSet> + <fileSet encoding="UTF-8"> + <directory></directory> + <includes> + <include>ReadMe.txt</include> + </includes> + </fileSet> + </fileSets> +</archetype-descriptor> Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/META-INF/maven/archetype-metadata.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/pom.xml?rev=1077827&r1=1077826&r2=1077827&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/pom.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/pom.xml Fri Mar 4 06:41:07 2011 @@ -31,13 +31,6 @@ <packaging>war</packaging> - <properties> - <camel-version>$CAMEL_VERSION_REPLACEME$</camel-version> - <activemq-version>$ACTIVEMQ_VERSION_REPLACEME$</activemq-version> - <jetty-version>$JETTY_VERSION_REPLACEME$</jetty-version> - <xbean-spring-version>$XBEAN_VERSION_REPLACEME$</xbean-spring-version> - </properties> - <dependencies> <dependency> <groupId>org.apache.camel</groupId> @@ -54,6 +47,11 @@ <version>${activemq-version}</version> </dependency> <dependency> + <groupId>org.apache.geronimo.specs</groupId> + <artifactId>geronimo-jms_1.1_spec</artifactId> + <version>${geronimo-jms-spec-version}</version> + </dependency> + <dependency> <groupId>org.apache.xbean</groupId> <artifactId>xbean-spring</artifactId> <version>${xbean-spring-version}</version> @@ -71,6 +69,19 @@ <artifactId>camel-stream</artifactId> <version>${camel-version}</version> </dependency> + + <!-- logging --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${slf4j-version}</version> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>${log4j-version}</version> + </dependency> + </dependencies> <build> @@ -80,7 +91,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> - <version>$MAVEN_COMPILER_PLUGIN_VERSION_REPLACEME$</version> + <version>${maven-compiler-plugin-version}</version> <configuration> <source>1.6</source> <target>1.6</target> @@ -115,4 +126,5 @@ </plugin> </plugins> </build> + </project> Added: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties?rev=1077827&view=auto ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties (added) +++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties Fri Mar 4 06:41:07 2011 @@ -0,0 +1,38 @@ +## ------------------------------------------------------------------------ +## 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. +## ------------------------------------------------------------------------ + +# +# The logging properties used +# +log4j.rootLogger=INFO, out + +# uncomment the following line to turn on Camel debugging +#log4j.logger.org.apache.camel=DEBUG + +# uncomment the following line to turn on ActiveMQ debugging +#log4j.logger.org.apache.activemq=DEBUG + +log4j.logger.org.springframework=WARN + + +# CONSOLE appender not used by default +log4j.appender.out=org.apache.log4j.ConsoleAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n +#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n + +log4j.throwableRenderer=org.apache.log4j.EnhancedThrowableRenderer \ No newline at end of file Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties ------------------------------------------------------------------------------ svn:eol-style = native Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties ------------------------------------------------------------------------------ svn:keywords = Rev Date Propchange: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/resources/log4j.properties ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml URL: http://svn.apache.org/viewvc/camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml?rev=1077827&r1=1077826&r2=1077827&view=diff ============================================================================== --- camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml (original) +++ camel/trunk/tooling/archetypes/camel-archetype-webconsole/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml Fri Mar 4 06:41:07 2011 @@ -27,44 +27,19 @@ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd "> - <amq:broker> - <amq:persistenceAdapter> - <amq:amqPersistenceAdapter syncOnWrite="false" - directory="${activemq.base}/data" maxFileLength="20 mb" /> - </amq:persistenceAdapter> - <!-- - The maximum about of space the broker will use before slowing down - producers - --> - <amq:systemUsage> - <amq:systemUsage> - <amq:memoryUsage> - <amq:memoryUsage limit="20 mb" /> - </amq:memoryUsage> - <amq:storeUsage> - <amq:storeUsage limit="1 gb" name="foo" /> - </amq:storeUsage> - <amq:tempUsage> - <amq:tempUsage limit="100 mb" /> - </amq:tempUsage> - </amq:systemUsage> - </amq:systemUsage> - - <!-- The transport connectors ActiveMQ will listen to --> - <amq:transportConnectors> - <amq:transportConnector name="openwire" - uri="tcp://localhost:61616" /> - <amq:transportConnector name="stomp" - uri="stomp://localhost:61613" /> - </amq:transportConnectors> - </amq:broker> - - <!-- - configure the camel activemq component to use the current broker - --> - <!-- create the activemq component so that we can use the activemq uri --> - <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" - p:brokerURL="vm://localhost?create=false&waitForStart=10000" /> + <!-- This creates an embedded ActiveMQ Broker --> + <broker xmlns="http://activemq.apache.org/schema/core" useJmx="false" persistent="false"> + <transportConnectors> + <transportConnector uri="tcp://localhost:61616" /> + </transportConnectors> + </broker> + + <!-- Lets connect the Camel ActiveMQ component to the embedded broker. + See http://camel.apache.org/activemq.html for more information. + --> + <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> + <property name="brokerURL" value="failover:tcp://localhost:61616"/> + </bean> <!-- Here is a sample which processes the input files (leaving them in @@ -72,28 +47,32 @@ queue is watched by another route which then performs content based routing on the messages using XPath. --> - <camel:camelContext> - <camel:package>${package}</camel:package> - <camel:route> - <camel:from uri="file:src/data?noop=true" /> + <camelContext xmlns="http://camel.apache.org/schema/spring"> + <!-- scan pacakge for RouteBuilder Java DSL classes --> + <package>${package}</package> + + <route> + <from uri="file:src/data?noop=true"/> <!-- Print the message to standard out, just as a test --> - <camel:convertBodyTo type="java.lang.String" /> - <camel:to uri="stream:out" /> - <camel:to uri="activemq:personnel.records" /> - </camel:route> - - <camel:route> - <camel:from uri="activemq:personnel.records" /> - <camel:choice> - <camel:when> - <camel:xpath>/person/city = 'London'</camel:xpath> - <camel:to uri="file:target/messages/uk" /> - </camel:when> - <camel:otherwise> - <camel:to uri="file:target/messages/others" /> - </camel:otherwise> - </camel:choice> - </camel:route> - </camel:camelContext> + <convertBodyTo type="String"/> + <to uri="stream:out"/> + <to uri="activemq:personnel.records"/> + </route> + + <route> + <from uri="activemq:personnel.records"/> + <choice> + <when> + <xpath>/person/city = 'London'</xpath> + <log message="UK message"/> + <to uri="file:target/messages/uk"/> + </when> + <otherwise> + <log message="Other message"/> + <to uri="file:target/messages/others"/> + </otherwise> + </choice> + </route> + </camelContext> </beans>