相关疑难解决方法(0)

创建一个新阶段

我正在使用Maven开发一个项目,我需要两个新的阶段:'analyze'和'eval'(针对不同的数据分析阶段).我已经阅读了所有可以找到的文档,并创建了components.xml和lifecycle.xml的版本,这些版本尽可能接近正确,但是Maven拒绝运行新的阶段.(我应该强调,我的插件工作没有问题,没有问题将它们绑定到默认生命周期提供的现有阶段.我的问题是我创建的新阶段似乎被maven忽略了.)我该怎么办?需要做的是让我的新阶段发挥作用?

lifecycles.xml:

<lifecycles>
  <lifecycle>
    <id>lenskit</id>
    <phases>
      <phase>
        <id>analyze</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
      <phase>
        <id>validate</id>
        <executions>
          <execution>
            <goals>
              <goal>greet</goal>
            </goals>
          </execution>
        </executions>
      </phase>
    </phases>
  </lifecycle>
</lifecycles>
Run Code Online (Sandbox Code Playgroud)

components.xml中:

<component-set>
  <components>
    <component>
      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
      <role-hint>lenskit</role-hint>
      <implementation>
        org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
      </implementation>
      <configuration>
         <id>lenskit</id>
         <phases>
            <phase>get-data</phase>
            <phase>analyze</phase>
            <phase>eval</phase>
         </phases>
         <default-phases>
            <verify> org.apache.maven.plugins:maven-resources-plugin:resources </verify>
            <get-data> org.riedl:hello-lenskit-plugin:greet </get-data>
            <analyze> org.riedl:hello-lenskit-plugin:greet </analyze>
            <eval> org.riedl:hello-lenskit-plugin:greet </eval>
            <package> org.riedl:hello-lenskit-plugin:greet </package>
         </default-phases>
      </configuration>
    </component>
  </components>
</component-set>
Run Code Online (Sandbox Code Playgroud)

maven-3 maven

27
推荐指数
2
解决办法
3万
查看次数

标签 统计

maven ×1

maven-3 ×1