Я учусь использовать Apache Camel с загрузкой Spring.Я работаю над демонстрацией, в которой я беру файл с FTP-местоположения и помещаю его в другое место.
Маршрут работает, когда я использую ftps uri непосредственно в методе from()
,Однако, когда я пытаюсь сохранить местоположение 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>
Может кто-нибудь указать, где я иду не так?Заранее спасибо!