我是maven和camel的新手.
我试着在骆驼书中执行这些例子.当我运行以下命令时,我收到此错误.
命令:
mvn test -Dtest= SpringTransformMethodTest
Run Code Online (Sandbox Code Playgroud)
错误:
[ERROR] Unknown lifecycle phase "SpringTransformMethodTest". You must specify a valid lifecycle phase or a goal in the f
ormat <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle ph
ases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, proce
ss-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile,
process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, ver
ify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the …Run Code Online (Sandbox Code Playgroud) 我对其中一个 jar 有依赖性,并且我已将其标记为在 pom xml 中提供。似乎只有一些传递依赖 jar 被标记为提供并且没有与 war 一起打包,但其他的仍然是编译和打包的范围。
pom xml 中的依赖:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
依赖树:
[INFO] +- org.apache.camel:camel-ftp:jar:2.17.0.redhat-630262:provided
[INFO] | +- com.jcraft:jsch:jar:0.1.54:provided
[INFO] | +- commons-net:commons-net:jar:3.3.0.redhat-3:provided
[INFO] | +- com.sun.xml.bind:jaxb-core:jar:2.2.11:compile
[INFO] | \- com.sun.xml.bind:jaxb-impl:jar:2.2.11.redhat-2:compile
[INFO] +- org.apache.camel:camel-csv:jar:2.17.0.redhat-630262:provided
Run Code Online (Sandbox Code Playgroud)
插件版本详情:
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<cdi.api.version>1.2.0.redhat-2</cdi.api.version>
<javax.inject.version>1.0.0.redhat-6</javax.inject.version>
<sonar.host.url>http://vfrde2srta0401.agcs.biz:9000</sonar.host.url>
<xerces.version>2.11.0-22</xerces.version>
<xmlunit.version>1.6</xmlunit.version>
<maven.compilerplugin.version>3.7.0</maven.compilerplugin.version>
<maven.releaseplugin.version>2.5.3</maven.releaseplugin.version>
<maven.warplugin.version>3.2.0</maven.warplugin.version>
<maven.jarplugin.version>3.0.2</maven.jarplugin.version>
<maven.surefireplugin.version>2.20.1</maven.surefireplugin.version>
<maven.coberturaplugin.version>2.7</maven.coberturaplugin.version>
Run Code Online (Sandbox Code Playgroud) 我理解GET和POST的定义如下.
GET:列出集合的成员,并使用其成员URI进行进一步导航.例如,列出所有待售汽车.
POST:在集合中创建一个新条目,集合自动分配ID.创建的ID通常作为此操作返回的数据的一部分包含在内.
MY API在服务器中搜索一些具有巨大请求负载的详细信息,在这种情况下我应该使用哪个动词?
也有人可以让我知道可以在查询字符串中传递的字符的长度.
我正在尝试将声纳Qube 5.5默认数据库更改为Mysql,但它仍在连接到默认H2 DB。
配置如下。
我已经在Mysql DB中运行以下脚本
# Create SonarQube database and user.
#
# Command: mysql -u root -p < create_database.sql
#
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
Run Code Online (Sandbox Code Playgroud)
取消对Mysql的sonar.jdbc.url的注释,我无法查看H2 DB的配置以对其进行注释。
# Property values can:
# - reference an environment variable, for example sonar.jdbc.url= ${env:SONAR_JDBC_URL}
# - be encrypted. See http://redirect.sonarsource.com/doc/settings-encryption.html
#--------------------------------------------------------------------------------------------------
# …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用骆驼 ftp 组件从 SFTP 服务器获取文件并以自定义方式处理它。我能够成功连接到 sftp 服务器并获取文件,但交换正文包含远程文件对象,文件包含 com.jcraft。 jsch.ChannelSftp$LsEntry 对象,当我在调试模式下检查文件对象时,它只包含有关文件的元数据信息。我在将其转换为文件时遇到类型转换异常。如何从交换对象获取文件以进行进一步的自定义处理。
当我使用文件而不是 SFTP 时一切正常。
骆驼路线:
<camelContext id="SourceContext" xmlns="http://camel.apache.org/schema/spring">
<routeContextRef ref="SourceTranslatorRouteContext" />
<threadPoolProfile customId="true"
id="SourceSplitThreadProfile" maxPoolSize="100" maxQueueSize="0"
poolSize="20" />
<route id="SourceOutWriteConsumerRoute" streamCache="true">
<from id="SourceEndpoint"
uri="sftp:{{SourceFtpHostname}}:22/{{directoryName}}?siteCommand=NAMEFMT
1&stepwise=false&fileName={{fileName}}&password={{SourceFtpPWD}}&username={{SourceFtpUname}}&useList=false&delete=true" />
<!-- <from id="SourceEndpoint" uri="file:{{directoryName}}?fileName={{fileName}}"/> -->
<removeHeaders id="_removeHeaders1" pattern="Camel*" />
<doTry id="_doTry1">
<setProperty id="_setProperty1" propertyName="policySublobGroup">
<simple>{{policySublobGroup}}</simple>
</setProperty>
<split id="_split1" parallelProcessing="true" streaming="true">
<method bean="customSplitter" method="splitPolicy" />
</split>
<doCatch id="_doCatch1">
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<
</doCatch>
</doTry>
</route>
</camelContext>
Run Code Online (Sandbox Code Playgroud)
自定义处理csv的Java方法。
public static List<List<Policy>> splitPolicy(final Exchange exchange) {
// …Run Code Online (Sandbox Code Playgroud)