http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java new file mode 100644 index 0000000..ef7a21c --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/property/springboot/ExchangePropertyLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.camel.language.property.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * An expression which extracts the named exchange property + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.exchangeproperty") +public class ExchangePropertyLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java new file mode 100644 index 0000000..49f3588 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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. + */ +package org.apache.camel.language.ref.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.ref.RefLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(RefLanguageConfiguration.class) +public class RefLanguageAutoConfiguration { + + @Bean(name = "ref-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(RefLanguage.class) + public RefLanguage configureRefLanguage(CamelContext camelContext, + RefLanguageConfiguration configuration) throws Exception { + RefLanguage language = new RefLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java new file mode 100644 index 0000000..29500c5 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/ref/springboot/RefLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.camel.language.ref.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For using a custom expression + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.ref") +public class RefLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java new file mode 100644 index 0000000..422ea84 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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. + */ +package org.apache.camel.language.simple.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.simple.FileLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(FileLanguageConfiguration.class) +public class FileLanguageAutoConfiguration { + + @Bean(name = "file-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(FileLanguage.class) + public FileLanguage configureFileLanguage(CamelContext camelContext, + FileLanguageConfiguration configuration) throws Exception { + FileLanguage language = new FileLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java new file mode 100644 index 0000000..f80a9e4 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/FileLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.camel.language.simple.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using the file/simple language + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.file") +public class FileLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java new file mode 100644 index 0000000..52811ec --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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. + */ +package org.apache.camel.language.simple.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.simple.SimpleLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(SimpleLanguageConfiguration.class) +public class SimpleLanguageAutoConfiguration { + + @Bean(name = "simple-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(SimpleLanguage.class) + public SimpleLanguage configureSimpleLanguage(CamelContext camelContext, + SimpleLanguageConfiguration configuration) throws Exception { + SimpleLanguage language = new SimpleLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java new file mode 100644 index 0000000..4c1e2e9 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.camel.language.simple.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using the simple language + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.simple") +public class SimpleLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java new file mode 100644 index 0000000..6a902ac --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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. + */ +package org.apache.camel.language.tokenizer.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.tokenizer.TokenizeLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(TokenizeLanguageConfiguration.class) +public class TokenizeLanguageAutoConfiguration { + + @Bean(name = "tokenize-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(TokenizeLanguage.class) + public TokenizeLanguage configureTokenizeLanguage( + CamelContext camelContext, + TokenizeLanguageConfiguration configuration) throws Exception { + TokenizeLanguage language = new TokenizeLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java new file mode 100644 index 0000000..8d0632e --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageConfiguration.java @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.camel.language.tokenizer.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using a body or header tokenizer. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.tokenize") +public class TokenizeLanguageConfiguration { + + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java new file mode 100644 index 0000000..9d8fd7b --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java @@ -0,0 +1,55 @@ +/** + * 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. + */ +package org.apache.camel.language.tokenizer.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.tokenizer.XMLTokenizeLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(XMLTokenizeLanguageConfiguration.class) +public class XMLTokenizeLanguageAutoConfiguration { + + @Bean(name = "xtokenize-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XMLTokenizeLanguage.class) + public XMLTokenizeLanguage configureXMLTokenizeLanguage( + CamelContext camelContext, + XMLTokenizeLanguageConfiguration configuration) throws Exception { + XMLTokenizeLanguage language = new XMLTokenizeLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java new file mode 100644 index 0000000..a245dc4 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageConfiguration.java @@ -0,0 +1,58 @@ +/** + * 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. + */ +package org.apache.camel.language.tokenizer.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For expressions and predicates using a body or header tokenizer. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.xtokenize") +public class XMLTokenizeLanguageConfiguration { + + /** + * The extraction mode. The available extraction modes are: i - injecting + * the contextual namespace bindings into the extracted token (default) w - + * wrapping the extracted token in its ancestor context u - unwrapping the + * extracted token to its child content t - extracting the text content of + * the specified element + */ + private String mode; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java new file mode 100644 index 0000000..2dfd6b8 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java @@ -0,0 +1,54 @@ +/** + * 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. + */ +package org.apache.camel.language.xpath.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.language.xpath.XPathLanguage; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(XPathLanguageConfiguration.class) +public class XPathLanguageAutoConfiguration { + + @Bean(name = "xpath-language") + @ConditionalOnClass(CamelContext.class) + @ConditionalOnMissingBean(XPathLanguage.class) + public XPathLanguage configureXPathLanguage(CamelContext camelContext, + XPathLanguageConfiguration configuration) throws Exception { + XPathLanguage language = new XPathLanguage(); + if (language instanceof CamelContextAware) { + ((CamelContextAware) language).setCamelContext(camelContext); + } + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, parameters, null, + false); + IntrospectionSupport.setProperties(camelContext, + camelContext.getTypeConverter(), language, parameters); + return language; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java new file mode 100644 index 0000000..efa0046 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageConfiguration.java @@ -0,0 +1,102 @@ +/** + * 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. + */ +package org.apache.camel.language.xpath.springboot; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * For XPath expressions and predicates + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@ConfigurationProperties(prefix = "camel.language.xpath") +public class XPathLanguageConfiguration { + + /** + * Name of class for document type The default value is org.w3c.dom.Document + */ + private String documentType; + /** + * Whether to use Saxon. + */ + private Boolean saxon = false; + /** + * References to a custom XPathFactory to lookup in the registry + */ + private String factoryRef; + /** + * The XPath object model to use + */ + private String objectModel; + /** + * Whether to log namespaces which can assist during trouble shooting + */ + private Boolean logNamespaces = false; + /** + * Whether to trim the value to remove leading and trailing whitespaces and + * line breaks + */ + private Boolean trim = true; + + public String getDocumentType() { + return documentType; + } + + public void setDocumentType(String documentType) { + this.documentType = documentType; + } + + public Boolean getSaxon() { + return saxon; + } + + public void setSaxon(Boolean saxon) { + this.saxon = saxon; + } + + public String getFactoryRef() { + return factoryRef; + } + + public void setFactoryRef(String factoryRef) { + this.factoryRef = factoryRef; + } + + public String getObjectModel() { + return objectModel; + } + + public void setObjectModel(String objectModel) { + this.objectModel = objectModel; + } + + public Boolean getLogNamespaces() { + return logNamespaces; + } + + public void setLogNamespaces(Boolean logNamespaces) { + this.logNamespaces = logNamespaces; + } + + public Boolean getTrim() { + return trim; + } + + public void setTrim(Boolean trim) { + this.trim = trim; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/resources/META-INF/LICENSE.txt ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-core-starter/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/resources/META-INF/NOTICE.txt ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-core-starter/src/main/resources/META-INF/NOTICE.txt new file mode 100644 index 0000000..2e215bf --- /dev/null +++ b/components-starter/camel-core-starter/src/main/resources/META-INF/NOTICE.txt @@ -0,0 +1,11 @@ + ========================================================================= + == NOTICE file corresponding to the section 4 d of == + == the Apache License, Version 2.0, == + == in this case for the Apache Camel distribution. == + ========================================================================= + + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). + + Please read the different LICENSE files present in the licenses directory of + this distribution. http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..0ec9c44 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,65 @@ +# +# 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. +# + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.component.direct.springboot.DirectComponentAutoConfiguration,\ +org.apache.camel.component.vm.springboot.VmComponentAutoConfiguration,\ +org.apache.camel.component.directvm.springboot.DirectVmComponentAutoConfiguration,\ +org.apache.camel.component.seda.springboot.SedaComponentAutoConfiguration,\ +org.apache.camel.component.log.springboot.LogComponentAutoConfiguration,\ +org.apache.camel.component.stub.springboot.StubComponentAutoConfiguration,\ +org.apache.camel.component.scheduler.springboot.SchedulerComponentAutoConfiguration,\ +org.apache.camel.component.xslt.springboot.XsltComponentAutoConfiguration,\ +org.apache.camel.component.validator.springboot.ValidatorComponentAutoConfiguration,\ +org.apache.camel.component.properties.springboot.PropertiesComponentAutoConfiguration,\ +org.apache.camel.impl.springboot.StringDataFormatAutoConfiguration,\ +org.apache.camel.impl.springboot.ZipDataFormatAutoConfiguration,\ +org.apache.camel.impl.springboot.GzipDataFormatAutoConfiguration,\ +org.apache.camel.impl.springboot.SerializationDataFormatAutoConfiguration,\ +org.apache.camel.language.constant.springboot.ConstantLanguageAutoConfiguration,\ +org.apache.camel.language.simple.springboot.SimpleLanguageAutoConfiguration,\ +org.apache.camel.language.ref.springboot.RefLanguageAutoConfiguration,\ +org.apache.camel.language.bean.springboot.BeanLanguageAutoConfiguration,\ +org.apache.camel.language.header.springboot.HeaderLanguageAutoConfiguration,\ +org.apache.camel.language.xpath.springboot.XPathLanguageAutoConfiguration,\ +org.apache.camel.language.simple.springboot.FileLanguageAutoConfiguration,\ +org.apache.camel.language.property.springboot.ExchangePropertyLanguageAutoConfiguration,\ +org.apache.camel.language.tokenizer.springboot.TokenizeLanguageAutoConfiguration,\ +org.apache.camel.language.tokenizer.springboot.XMLTokenizeLanguageAutoConfiguration + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/camel-core-starter/src/main/resources/META-INF/spring.provides ---------------------------------------------------------------------- diff --git a/components-starter/camel-core-starter/src/main/resources/META-INF/spring.provides b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000..addedf3 --- /dev/null +++ b/components-starter/camel-core-starter/src/main/resources/META-INF/spring.provides @@ -0,0 +1,18 @@ +# +# 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. +# + +provides: camel-core \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components-starter/pom.xml ---------------------------------------------------------------------- diff --git a/components-starter/pom.xml b/components-starter/pom.xml index 8affa54..7872c11 100644 --- a/components-starter/pom.xml +++ b/components-starter/pom.xml @@ -98,6 +98,7 @@ <module>camel-cometd-starter</module> <module>camel-consul-starter</module> <module>camel-context-starter</module> + <module>camel-core-starter</module> <module>camel-core-xml-starter</module> <module>camel-couchdb-starter</module> <module>camel-crypto-starter</module> http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/components/pom.xml ---------------------------------------------------------------------- diff --git a/components/pom.xml b/components/pom.xml index 10ea47e..dd2cec8 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -31,22 +31,6 @@ <description>Camel Components</description> <packaging>pom</packaging> - <!-- to support spring-boot auto configuration in the Camel components --> - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot</artifactId> - <version>${spring-boot-version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-autoconfigure</artifactId> - <version>${spring-boot-version}</version> - <scope>provided</scope> - </dependency> - </dependencies> - <modules> <!-- we want to test these modules first to catch any errors early as possible --> <module>camel-test</module> http://git-wip-us.apache.org/repos/asf/camel/blob/d10555fa/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java ---------------------------------------------------------------------- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java index bfc5331..1b701ed 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootStarterMojo.java @@ -264,7 +264,7 @@ public class SpringBootStarterMojo extends AbstractMojo { Set<String> configExclusions = new HashSet<>(); Properties properties = new Properties(); properties.load(getClass().getResourceAsStream("/spring-boot-fix-dependencies.properties")); - String artExcl = properties.getProperty("exclude_" + project.getArtifactId()); + String artExcl = properties.getProperty("exclude_" + project.getArtifactId()); getLog().debug("Configured exclusions: " + artExcl); if (artExcl != null && artExcl.trim().length() > 0) { for (String dep : artExcl.split(",")) { @@ -350,7 +350,8 @@ public class SpringBootStarterMojo extends AbstractMojo { modules.removeChild(modules.getFirstChild()); } - for (File starterDir : Arrays.asList(allStartersDir().listFiles((f, n) -> (new File(f, n)).isDirectory() && n.endsWith(SpringBootHelper.STARTER_SUFFIX))).stream().sorted().collect(Collectors.toList())) { + for (File starterDir : Arrays.asList(allStartersDir().listFiles((f, n) -> (new File(f, n)).isDirectory() && n.endsWith(SpringBootHelper.STARTER_SUFFIX))).stream().sorted().collect + (Collectors.toList())) { Node module = pom.createElement("module"); module.setTextContent(starterDir.getName()); modules.appendChild(module); @@ -498,16 +499,28 @@ public class SpringBootStarterMojo extends AbstractMojo { } private void writeIfChanged(String content, File file) throws IOException { - try (FileReader fr = new FileReader(file)) { - String oldContent = IOUtils.toString(fr); - if (!content.equals(oldContent)) { - getLog().debug("Writing new file " + file.getAbsolutePath()); - fr.close(); - try (FileWriter fw = new FileWriter(file)) { - IOUtils.write(content, fw); + boolean write = true; + + if (file.exists()) { + try (FileReader fr = new FileReader(file)) { + String oldContent = IOUtils.toString(fr); + if (!content.equals(oldContent)) { + getLog().debug("Writing new file " + file.getAbsolutePath()); + fr.close(); + } else { + getLog().debug("File " + file.getAbsolutePath() + " has been left unchanged"); + write = false; } - } else { - getLog().debug("File " + file.getAbsolutePath() + " has been left unchanged"); + } + } else { + // Create the structure + File parent = file.getParentFile(); + parent.mkdirs(); + } + + if (write) { + try (FileWriter fw = new FileWriter(file)) { + IOUtils.write(content, fw); } } }