当我在IDE中运行它时,它工作正常..但是当我在控制台中运行它时我得到了以下异常
App initializePluginorg.apache.camel.ResolveEndpointFailedException中的错误:无法解析端点:restlet:// http://localhost:1705/api/v1/app?restletMethods=POST由于:找不到合适的属性setter:restletMethods,因为没有setter方法具有相同类型:java.lang.String或类型转换可能:没有类型转换器可用于从类型:java.lang.String转换为所需类型:org.restlet.data.Method []具有值POST
在比较两种情况的日志时,我发现某些类型转换器没有被加载。
IDE日志 - 工作正常
09:23:20.654 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - 找到包含16个@Converter类的3个包 09:23:20.747 [main] DEBUG oacicAnnotationTypeConverterLoader - 加载文件META-INF / services / org / apache / camel / TypeConverter从url:jar:file:/ C:/Users/user/.m2检索包列表/repository/org/apache/camel/camel-core/2.17.1/camel-core-2.17.1.jar!/META-INF/services/org/apache/camel/TypeConverter 09:23:20.749 [main] DEBUG oacicAnnotationTypeConverterLoader - 加载文件META-INF / services / org / apache / camel / TypeConverter从url:jar:file:/ C:/Users/user/.m2检索包列表/repository/org/apache/camel/camel-spring/2.17.1/camel-spring-2.17.1.jar!/META-INF/services/org/apache/camel/TypeConverter 09:23:20.751 [main] DEBUG oacicAnnotationTypeConverterLoader - 加载文件META-INF / services / org / apache / camel / TypeConverter从url:jar:file:/ C:/Users/user/.m2检索包列表/repository/org/apache/camel/camel-restlet/2.17.1/camel-restlet-2.17.1.jar!/META-INF/services/org/apache/camel/TypeConverter 09:23:20.752 [main] DEBUG oacicAnnotationTypeConverterLoader - 加载文件META-INF / services / org / apache / camel / TypeConverter从url:jar:file:/ C:/Users/user/.m2检索包列表/repository/org/apache/camel/camel-http4/2.17.1/camel-http4-2.17.1.jar!/META-INF/services/org/apache/camel/TypeConverter 09:23:20.754 [main] DEBUG oacicAnnotationTypeConverterLoader - 加载文件META-INF / services / org / apache / camel / TypeConverter从url:jar:file:/ C:/Users/user/.m2检索包列表/repository/org/apache/camel/camel-http-common/2.17.1/camel-http-common-2.17.1.jar!/META-INF/services/org/apache/camel/TypeConverter 09:23:20.779 [main] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - 已加载5个@Converter类 09:23:20.837 [主要] INFO o.a.c.i.c.DefaultTypeConverter - 加载196型转换器
控制台日志 - 抛出异常
12:06:41.741 [CamelThread] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - 找到3个包16 @Converter类加载12:06:41.806 [CamelThread] DEBUG o.a.c.i.c.AnnotationTypeConverterLoader - 加载文件 META-INF / services / org / apache / camel / TypeConverter检索列表 来自网址的包: 罐子:文件:/ C:/projects/user/org/distribution/target/blah.tar/blah/Plugins/blahblah.jar / META-INF /服务/组织/阿帕奇/骆驼/类型转换器 12:06:41.812 [CamelThread]调试 o.a.c.i.c.AnnotationTypeConverterLoader - 没有其他包名称 在类路径中找到带注释的类型转换器。 12:06:41.813 [CamelThread] INFO o.a.c.i.c.DefaultTypeConverter - 已加载182类型 转换器
pom文件 4.0.0
<groupId>com.org.unit.proj</groupId>
<artifactId>blahblah</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<resource.path.proj>${project.build.directory}/dependencies/proj/</resource.path.proj>
<projDistributionPkgVersion>1.0.1</projDistributionPkgVersion>
<java.version>1.8</java.version>
<camel.version>2.17.1</camel.version>
<cbor.version>0.5</cbor.version>
</properties>
<parent>
<groupId>com.org.team</groupId>
<artifactId>master-build-configuration</artifactId>
<version>1.0.5</version>
</parent>
<dependencies>
<dependency>
<groupId>com.org.unit</groupId>
<artifactId>proj-name-distribution</artifactId>
<version>${projDistributionPkgVersion}</version>
<type>tar.gz</type>
</dependency>
<dependency>
<groupId>com.org.unit.proj</groupId>
<artifactId>proj-name-main</artifactId>
<version>${projDistributionPkgVersion}</version>
<scope>system</scope>
<systemPath>${resource.path.proj}proj-name-main.jar</systemPath>
</dependency>
<dependency>
<groupId>co.nstant.in</groupId>
<artifactId>cbor</artifactId>
<version>${cbor.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-spring</artifactId>
<version>${camel.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-restlet</artifactId>
<version>${camel.version}</version>
</dependency>-->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http4</artifactId>
<version>${camel.version}</version>
</dependency>
</dependencies>
<build>
<finalName>blahblah</finalName>
<plugins>
<!-- Include dependency plugins in final jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.org.unit</groupId>
<artifactId>proj-name-distribution</artifactId>
<version>${projDistributionPkgVersion}</version>
<type>tar.gz</type>
<outputDirectory>${resource.path.proj}</outputDirectory>
<includes>*.jar</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
如何正确打包?有没有办法可以在pom中指定专门包含typeconvertors?