我正在学习将 Apache Camel 与 Spring Boot 一起使用。我正在做一个演示,我正在从 FTP 位置获取文件并将其拖放到不同的位置。
当我直接在from()
方法中使用 ftps uri 时,该路由有效。但是,当我尝试将 ftps 位置存储在 application.properties 文件中并从那里访问它时,我收到一个Mark Invalid错误。
这有效:
@Override
public void configure() throws Exception {
fromFile();
}
public void fromFTP() {
from("ftps:username@localhost/pickup?password=xxxx&delete=true")
.to("file:E:/output");
}
这不是:
application.properties文件
ftps.pickup.location=ftps:username@localhost/pickup?password=xxxx
骆驼路线
@Override
public void configure() throws Exception {
fromFile();
}
public void fromFTP() {
from("{{ftps.pickup.location}}&delete=true")
.to("file:E:/output");
}
这是我得到的错误:
C:\Users\pathaks\eclipse-workspace\camel-spring-demo>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building camel-spring-demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ camel-spring-demo --
-
[INFO] Deleting C:\Users\pathaks\eclipse-workspace\camel-spring-demo\target
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ camel-spri
ng-demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.996 s
[INFO] Finished at: 2018-11-17T17:56:48Z
[INFO] Final Memory: 22M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2
.7:resources (default-resources) on project camel-spring-demo: Mark invalid -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pathak</groupId>
<artifactId>camel-spring-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.17.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>2.21.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>2.21.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-csv</artifactId>
<version>2.21.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
谁能指出我哪里出错了?提前致谢!