Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot Quarkus Jandex索引无法解析工件org.springframework:spring web_Spring Boot_Maven_Cdi_Quarkus - Fatal编程技术网

Spring boot Quarkus Jandex索引无法解析工件org.springframework:spring web

Spring boot Quarkus Jandex索引无法解析工件org.springframework:spring web,spring-boot,maven,cdi,quarkus,Spring Boot,Maven,Cdi,Quarkus,我正在尝试在Quarkus中迁移spring引导应用程序。 经过一些尝试,我发现并不是所有的bean都被发现了,所以我尝试按照这个指南创建jandex索引。 除了spring web工件之外,所有其他依赖项都很容易被发现,但当spring web出现时,它会显示: 无法解析工件org.springframework:springweb:null 存储库应该是 这是我的application.yaml文件 quarkus: http: port: 8998 log: lev

我正在尝试在Quarkus中迁移spring引导应用程序。 经过一些尝试,我发现并不是所有的bean都被发现了,所以我尝试按照这个指南创建jandex索引。 除了spring web工件之外,所有其他依赖项都很容易被发现,但当spring web出现时,它会显示:

无法解析工件org.springframework:springweb:null

存储库应该是

这是我的application.yaml文件

quarkus:
  http:
    port: 8998
  log:
    level: DEBUG
  index-dependency:
    bear-arch-rest:
      group-id: org.acme.bear
      artifact-id: bear-arch-rest
    bear-arch-core:
      group-id: org.acme.bear
      artifact-id: bear-arch-core
    bear-arch-exception:
      group-id: org.acme.bear
      artifact-id: bear-arch-exception
    spring-hateoas:
      group-id: org.springframework.hateoas
      artifact-id: spring-hateoas
    spring-web:
      group-id: org.springframework
      artifact-id: spring-web
然后,当我尝试构建项目时,会显示一条错误消息,其中包含:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.4.Final-redhat-00001:build (default) on project darwin-on-quarkus-rest: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.deployment.index.ApplicationArchiveBuildStep#build threw an exception: java.lang.RuntimeException: java.lang.RuntimeException: Could not resolve artifact org.springframework:spring-web:null. Please make sure it is present and contains a META-INF/MANIFEST.MF file. Note that artifacts that are part of the same project may not always be resolvable, in this case you should generate a META-INF/jandex.idx file instead using the Jandex Maven plugin.
[ERROR]     at io.quarkus.deployment.index.ApplicationArchiveBuildStep.getIndexDependencyPaths(ApplicationArchiveBuildStep.java:148)
[ERROR]     at io.quarkus.deployment.index.ApplicationArchiveBuildStep.scanForOtherIndexes(ApplicationArchiveBuildStep.java:110)
[ERROR]     at io.quarkus.deployment.index.ApplicationArchiveBuildStep.build(ApplicationArchiveBuildStep.java:97)
[ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:938)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:273)
[ERROR]     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]     at java.lang.Thread.run(Thread.java:748)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.lang.RuntimeException: Could not resolve artifact org.springframework:spring-web:null. Please make sure it is present and contains a META-INF/MANIFEST.MF file. Note that artifacts that are part of the same project may not always be resolvable, in this case you should generate a META-INF/jandex.idx file instead using the Jandex Maven plugin.
[ERROR]     at io.quarkus.deployment.index.ClassPathArtifactResolver.getArtifact(ClassPathArtifactResolver.java:68)
[ERROR]     at io.quarkus.deployment.index.ArtifactIndex.getPath(ArtifactIndex.java:14)
[ERROR]     at io.quarkus.deployment.index.ApplicationArchiveBuildStep.getIndexDependencyPaths(ApplicationArchiveBuildStep.java:136)
[ERROR]     ... 14 more
[ERROR] -> [Help 1]
我尝试使用分类器,但这并没有改变任何事情

当我尝试删除quarkus.index-dependency.spring-web属性并尝试构建时,它显示:

[INFO] --- quarkus-maven-plugin:1.3.4.Final-redhat-00001:build (default) @ darwin-on-quarkus-rest ---
[INFO] [org.jboss.threads] JBoss Threads version 3.1.1.Final-redhat-00001
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.web.filter.AbstractRequestLoggingFilter: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.web.filter.AbstractRequestLoggingFilter was not found in Jandex index. Please ensure the class is part of the index.
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.scheduling.annotation.AsyncConfigurerSupport: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.scheduling.annotation.AsyncConfigurerSupport was not found in Jandex index. Please ensure the class is part of the index.
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.web.servlet.config.annotation.WebMvcConfigurer: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.web.servlet.config.annotation.WebMvcConfigurer was not found in Jandex index. Please ensure the class is part of the index.
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.web.servlet.HandlerInterceptor: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.web.servlet.HandlerInterceptor was not found in Jandex index. Please ensure the class is part of the index.
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.beans.factory.DisposableBean: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.beans.factory.DisposableBean was not found in Jandex index. Please ensure the class is part of the index.
[WARNING] [io.quarkus.arc.processor.BeanArchives] Failed to index org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: Class does not exist in ClassLoader QuarkusClassLoader:Deployment Class Loader
[INFO] [io.quarkus.arc.processor.IndexClassLookupUtils] Class for name: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter was not found in Jandex index. Please ensure the class is part of the index.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:45 min
[INFO] Finished at: 2020-08-03T14:30:48+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.4.Final-redhat-00001:build (default) on project darwin-on-quarkus-rest: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.arc.deployment.ArcProcessor#registerBeans threw an exception: java.lang.IllegalArgumentException: Producer method return type not found in index: org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
[ERROR]     at io.quarkus.arc.processor.Types.getProducerMethodTypeClosure(Types.java:176)
[ERROR]     at io.quarkus.arc.processor.Beans.createProducerMethod(Beans.java:172)
[ERROR]     at io.quarkus.arc.processor.BeanDeployment.findBeans(BeanDeployment.java:763)
[ERROR]     at io.quarkus.arc.processor.BeanDeployment.registerBeans(BeanDeployment.java:206)
[ERROR]     at io.quarkus.arc.processor.BeanProcessor.registerBeans(BeanProcessor.java:122)
[ERROR]     at io.quarkus.arc.deployment.ArcProcessor.registerBeans(ArcProcessor.java:262)
[ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:938)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:273)
[ERROR]     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]     at java.lang.Thread.run(Thread.java:748)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

谢谢你的帮助

我收到quarkus支持部门的答复,您可以在那里找到

简言之:

  • 您必须使用Quarkus扩展获取可在此处找到的兼容依赖项列表
  • 如果您已经有一个springboot应用程序,迁移到Quarkus的唯一方法是更改很少的代码以遵守Quarkus的限制
    干杯