You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/09/05 11:22:44 UTC

svn commit: r992744 - in /camel/trunk: apache-camel/pom.xml apache-camel/src/main/descriptors/common-bin.xml components/camel-jasypt/pom.xml components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java parent/pom.xml

Author: davsclaus
Date: Sun Sep  5 09:22:43 2010
New Revision: 992744

URL: http://svn.apache.org/viewvc?rev=992744&view=rev
Log:
CAMEL-2987: Added camel-jasypt to the kit.

Modified:
    camel/trunk/apache-camel/pom.xml
    camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
    camel/trunk/components/camel-jasypt/pom.xml
    camel/trunk/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
    camel/trunk/parent/pom.xml

Modified: camel/trunk/apache-camel/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/pom.xml?rev=992744&r1=992743&r2=992744&view=diff
==============================================================================
--- camel/trunk/apache-camel/pom.xml (original)
+++ camel/trunk/apache-camel/pom.xml Sun Sep  5 09:22:43 2010
@@ -160,6 +160,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-jasypt</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-javaspace</artifactId>
     </dependency>
     <dependency>

Modified: camel/trunk/apache-camel/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/camel/trunk/apache-camel/src/main/descriptors/common-bin.xml?rev=992744&r1=992743&r2=992744&view=diff
==============================================================================
--- camel/trunk/apache-camel/src/main/descriptors/common-bin.xml (original)
+++ camel/trunk/apache-camel/src/main/descriptors/common-bin.xml Sun Sep  5 09:22:43 2010
@@ -63,6 +63,7 @@
         <include>org.apache.camel:camel-ibatis</include>
         <include>org.apache.camel:camel-irc</include>
         <include>org.apache.camel:camel-jackson</include>
+        <include>org.apache.camel:camel-jasypt</include>
         <include>org.apache.camel:camel-javaspace</include>
         <include>org.apache.camel:camel-jaxb</include>
         <include>org.apache.camel:camel-jcr</include>

Modified: camel/trunk/components/camel-jasypt/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jasypt/pom.xml?rev=992744&r1=992743&r2=992744&view=diff
==============================================================================
--- camel/trunk/components/camel-jasypt/pom.xml (original)
+++ camel/trunk/components/camel-jasypt/pom.xml Sun Sep  5 09:22:43 2010
@@ -27,7 +27,8 @@
     </parent>
 
     <artifactId>camel-jasypt</artifactId>
-    <packaging>bundle</packaging>
+    <!-- the packaging will be a bundle, however we need to add maniclass etc so we use the jar packaging -->
+    <packaging>jar</packaging>
     <name>Camel :: Jasypt</name>
     <description>Camel Jasypt support</description>
 
@@ -85,6 +86,40 @@
         </dependency>
     </dependencies>
 
-    <!-- TODO: maven stuff to define a Main class in MANIFEST.MF so we can easily run it from cmd line, using java -jar camel-jasypt -->
+    <build>
+        <plugins>
+
+            <!-- add OSGi to the MANIFEST.MF file -->
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- add main class and classpath to the MANIFEST.MF file -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                        <manifest>
+                            <addClasspath>true</addClasspath>
+                            <mainClass>org.apache.camel.component.jasypt.Main</mainClass>
+                        </manifest>
+                    </archive>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
 
 </project>

Modified: camel/trunk/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java?rev=992744&r1=992743&r2=992744&view=diff
==============================================================================
--- camel/trunk/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java (original)
+++ camel/trunk/components/camel-jasypt/src/main/java/org/apache/camel/component/jasypt/JasyptPropertiesParser.java Sun Sep  5 09:22:43 2010
@@ -21,8 +21,8 @@ import org.apache.camel.util.ObjectHelpe
 import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
 
 /**
- * A {@link org.apache.camel.component.properties.PropertiesParser} which is using Jasypt
- * to decrypt any encrypted values.
+ * A {@link org.apache.camel.component.properties.PropertiesParser} which is using
+ * <a href="http://www.jasypt.org/">Jasypt</a> to decrypt any encrypted values.
  * <p/>
  * The values must be enclosed in the prefix and suffix token.
  *
@@ -30,8 +30,8 @@ import org.jasypt.encryption.pbe.Standar
  */
 public class JasyptPropertiesParser extends DefaultPropertiesParser {
 
-    public static final String JASYPT_PREFIX_TOEKN = "ENC(";
-    public static final String JASYPT_SUFFIX_TOEKN = ")";
+    public static final String JASYPT_PREFIX_TOKEN = "ENC(";
+    public static final String JASYPT_SUFFIX_TOKEN = ")";
 
     // TODO: A JasyptComponent we can leverage instead of directly from here
     private StandardPBEStringEncryptor encryptor;
@@ -51,7 +51,6 @@ public class JasyptPropertiesParser exte
             password = System.getProperty(ObjectHelper.after(password, "sys:"));
         }
         this.password = password;
-
     }
 
     public String getAlgorithm() {
@@ -79,7 +78,7 @@ public class JasyptPropertiesParser exte
     @Override
     public String parsePropertyValue(String value) {
         // check if the value is using the tokens
-        String text = ObjectHelper.between(value, JASYPT_PREFIX_TOEKN, JASYPT_SUFFIX_TOEKN);
+        String text = ObjectHelper.between(value, JASYPT_PREFIX_TOKEN, JASYPT_SUFFIX_TOKEN);
         if (text == null) {
             // not encrypted
             return value;

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=992744&r1=992743&r2=992744&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Sun Sep  5 09:22:43 2010
@@ -382,6 +382,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-jasypt</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-javaspace</artifactId>
         <version>${project.version}</version>
       </dependency>