web-dev-qa-db-ja.com

maven-shade-plugin-クラスorg.Apache.maven.plugins.shade.resource.ManifestResourceTransformerに「リソース」が見つかりません

Apache mavenのドキュメントからmavenシェードプラグインの設定を直接コピーしました https://maven.Apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

これは私の現在のセットアップです:

      <plugin>
    <groupId>org.Apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
      <execution>
        <goals>
          <goal>shade</goal>
        </goals>
        <configuration>
          <transformers>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.ManifestResourceTransformer">
              <manifestEntries>
                <Main-Class>com.my.app.MainClass</Main-Class>
                <X-Compile-Source-JDK>1.8</X-Compile-Source-JDK>
                <X-Compile-Target-JDK>1.8</X-Compile-Target-JDK>
              </manifestEntries>
            </transformer>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                <resource>.properties</resource>
            </transformer>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.AppendingTransformer">
                <resource>META-INF/spring.handlers</resource>
            </transformer>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.AppendingTransformer">
                <resource>META-INF/spring.schemas</resource>
            </transformer>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.AppendingTransformer">
                <resource>META-INF/spring.tooling</resource>
            </transformer>
            <transformer implementation="org.Apache.maven.plugins.shade.resource.AppendingTransformer">
                <resource>META-INF/spring.factories</resource>
            </transformer>              
          </transformers>
        </configuration>
      </execution>
    </executions>
  </plugin>

そして、私は次のエラーを得ています:

[エラー]プロジェクトcpms-batchでゴールorg.Apache.maven.plugins:maven-shade-plugin:3.1.0:shade(デフォルト)を実行できませんでした:mojo org.Apache.maven.plugins:mavenの構成を解析できません-shade-plugin:3.1.0:shade for parameter resource: 'resource' not found in class org.Apache.maven.plugins.shade.resource.ManifestResourceTransformer-> [Help 1] org.Apache.maven.lifecycle.LifecycleExecutionException:プロジェクトcpms-batchでゴールorg.Apache.maven.plugins:maven-shade-plugin:3.1.0:shade(デフォルト)を実行できませんでした:mojo org.Apache.maven.plugins:maven-shade-の構成を解析できませんplugin:3.1.0:shade for parameter resource: 'resource' not found in class org.Apache.maven.plugins.shade.resource.ManifestResourceTransformer at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java: 212)org.Apache.mのorg.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:145)のorg.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:153)でaven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:116)(org.Apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.Java:80)(org.Apache.maven.lifecycle.internal.builder)) singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.Java:51)at org.Apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.Java:128)at org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:307) org.Apache.maven.DefaultMaven.doExecute(DefaultMaven.Java:193)at org.Apache.maven.DefaultMaven.execute(DefaultMaven.Java:106)at org.Apache.maven.cli.MavenCli.execute(MavenCli.Java :863)org.Apache.maven.cli.MavenCli.doMain(MavenCli.Java:288)at org.Apache.maven.cli.MavenCli.main(MavenCli.Java:199)at Sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド)Sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.Java:43)at Java.lang.reflect.Method.invoke(Method.Java:498)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.Java:289)at org.codehaus.plexus .classworlds.launcher.Launcher.launch(Launcher.Java:229)(org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.Java:415)at org.codehaus.plexus.classworlds.launcher.Launcher.main) (Launcher.Java:356)原因:org.Apache.maven.plugin.PluginConfigurationException:パラメータリソースのmojo org.Apache.maven.plugins:maven-shade-plugin:3.1.0:shadeの構成を解析できません:できませんクラスorg.Apache.maven.plugins.shade.resource.ManifestResourceTransformerのorg.Apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.Java:662)のorg.Apache.maven.plugin.internalで 'resource'を見つけます.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.Java:594)at org.Apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPlug inManager.Java:121)at org.Apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.Java:207)... 20以上原因:org.codehaus.plexus.component.configurator.ComponentConfigurationException:が見つかりません ' org.Eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.Java:252)のorg.codehaus.plexus.component.configurator.converters.compositeにあるクラスorg.Apache.maven.plugins.shade.resource.ManifestResourceTransformerのリソース.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.Java:101)at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.Java:57)at org.codehaus.plexus.component.configurator.converters.composite .AbstractCollectionConverter.fromChildren(AbstractCollectionConverter.Java:54)(org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromConfiguration(ArrayConverter.Java:52)(org.Eclipse.sisu.plexus.CompositeBeanHelp) er.convertProperty(CompositeBeanHelper.Java:273)(org.Eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.Java:210)at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter。 Java:101)org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.Java:34)at org.Apache.maven.plugin.internal.DefaultMavenPluginManager.populatePluginFields(DefaultMavenPluginManager.Java:632)... 23詳細[エラー]

答えなしでそのエラーに関する複数の質問を見てきました: パラメーターリソースのシェード:クラスorg.Apache.maven.plugins.shade.resource.ManifestResourceTransformerで 'resource'が見つかりません

org.Apache.maven.plugins.shade.resource.ManifestResourceTransformerクラスに「リソース」が見つかりません

誰かがそれを解決できたか、その理由を見つけましたか?

5
Yakiv

Spring Bootには、独自のmaven-shade-plugin設定があります。このプロパティをpom.xmlに追加します。

<properties>
  <start-class>com.ing.tpa.core.test.integration.apns.mock.MockAPNSServer</start-class>
</properties>
2
memcpy