Индекс Quarkus Jandex не может разрешить артефакт org.springframework: spring-web - PullRequest
2 голосов
/ 03 августа 2020

Я пытаюсь перенести приложение весенней загрузки в Quarkus. После некоторой попытки я обнаружил, что не все мои beans обнаружены, поэтому я пытаюсь следовать этому руководству и создать индекс jandex https://quarkus.io/guides/cdi-reference. За исключением артефакта Spring-Web, все другие зависимости были легко обнаружены, но когда приходит время Spring-Web, он отображает:

Не удалось разрешить артефакт org.springframework: spring-web: null

Репозиторий должен быть https://mvnrepository.com/artifact/org.springframework/spring-web/4.3.28.RELEASE

Вот мой файл 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 .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

Спасибо за вашу помощь!

1 Ответ

2 голосов
/ 06 августа 2020

Получил ответ от службы поддержки quarkus, вы можете найти его там https://quarkusio.zulipchat.com/#narrow / stream / 187030-users / topic / Quarkus.20CDI.3A.20Spring-Web.20Artifact.20Could.20Not.20Be. 20Решено .

В двух словах:

  • Вы должны использовать Quarkus Extensions для списка совместимых зависимостей, который вы можете найти здесь https://quarkus.io/guides/#compatibility.
  • Если у вас уже есть приложение springboot, единственный способ перейти на Quarkus - это изменить очень немного кода, чтобы придерживаться ограничений Quarkus Ура
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...