m2e 中未涵盖 yuicompressor 插件执行

发布于 2024-11-07 00:46:15 字数 929 浏览 4 评论 0原文

经过长时间搜索我可以在 Maven 中使用的 JavaScript 压缩器,我终于找到了一个:

        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>yuicompressor-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compress</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <jswarn>false</jswarn>
            </configuration>
        </plugin>

现在在 Eclipse 中的最新版本的 m2e 中,我收到以下错误:

生命周期配置未涵盖插件执行:net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress(执行:默认,阶段:进程资源)

可爱。我不明白——这只是一个插件。为什么 m2e 不能简单地调用我拥有的任何旧插件?这有什么问题吗?我该如何解决这个问题?

After a long search for a JavaScript compressor I could use in Maven, I finally found one:

        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>yuicompressor-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compress</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <jswarn>false</jswarn>
            </configuration>
        </plugin>

Now in the latest version of m2e in Eclipse, I get the following error:

Plugin execution not covered by lifecycle configuration: net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress (execution: default, phase: process-resources)

Lovely. I don't get it---it's just a plugin. Why can't m2e simply call any old plugin I have? What's wrong with this one? How do I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

樱桃奶球 2024-11-14 00:46:15

请参阅http://wiki.eclipse.org/M2E_plugin_execution_not_covered

为了解决一些长期存在的问题,
m2e 1.0 需要明确的指令
如何使用所有 Maven 插件
绑定到“有趣”的阶段(参见 M2E
有趣的生命周期阶段

项目构建生命周期。我们称这些为
说明“项目构建生命周期
映射”或简称“生命周期映射”
因为它们定义了 m2e 映射的方式
来自项目 pom.xml 文件的信息
到 Eclipse 工作区项目
期间的配置和行为
Eclipse 工作区构建。

项目构建生命周期映射
配置可以指定在
项目 pom.xml,贡献者
Eclipse 插件还有
某些的默认配置
常用的 Maven 插件已发货
与 m2e。我们称这些为“生命周期”
映射元数据源”。m2e 将
为所有人创建如下错误标记
没有的插件执行
生命周期映射在任何
映射元数据源。

生命周期配置未涵盖插件执行:
org.apache.maven.plugins:maven-antrun-plugin:1.3:运行
   (执行:生成源输入,阶段:生成源)

m2e匹配插件
使用执行操作
插件groupId的组合,
artifactId、版本范围和目标。
m2e 有 3 个基本动作
可以指示使用插件来做
执行——忽略执行
委托给项目配置器

See http://wiki.eclipse.org/M2E_plugin_execution_not_covered

To solve some long-standing issues,
m2e 1.0 requires explicit instructions
what to do with all Maven plugins
bound to "interesting" phases (see M2E
interesting lifecycle phases
) of
project build lifecycle. We call these
instructions "project build lifecycle
mapping" or simply "lifecycle mapping"
because they define how m2e maps
information from project pom.xml file
to Eclipse workspace project
configuration and behaviour during
Eclipse workspace build.

Project build lifecycle mapping
configuration can be specified in
project pom.xml, contributed by
Eclipse plugins and there is also
default configuration for some
commonly used Maven plugins shipped
with m2e. We call these "lifecycle
mapping metadata sources". m2e will
create error marker like below for all
plugin executions that do not have
lifecycle mapping in any of the
mapping metadata sources.

Plugin execution not covered by lifecycle configuration:
org.apache.maven.plugins:maven-antrun-plugin:1.3:run
   (execution: generate-sources-input, phase: generate-sources)

m2e matches plugin
executions to actions using
combination of plugin groupId,
artifactId, version range and goal.
There are three basic actions that m2e
can be instructed to do with a plugin
execution -- ignore, execute and
delegate to a project configurator.

何处潇湘 2024-11-14 00:46:15

如果您四处搜索,您会发现很多链接向您展示如何抑制该错误。然而,我找到了一种方法,可以让默认的 Maven Project Builder 在 eclipse 中实际执行这些插件。关键是将您在许多建议中找到的 更改为 。将其添加到我的 pom 后,我只需用户保存 javascript 资源即可自动聚合、压缩和部署:

<pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        net.alchim31.maven
                                    </groupId>
                                    <artifactId>
                                        yuicompressor-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.1,)
                                    </versionRange>
                                    <goals>
                                        <goal>compress</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute></execute>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

If you search around, you'll find a lot of links showing you how to suppress that error. However, I found a way to actually have the default Maven Project Builder execute these plugins within eclipse. The key is to change the <ignore> you find in many suggestions to <execute>. After adding this to my pom, I have automatic aggregation, compression, and deployment off of just a user saving a javascript resource:

<pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        net.alchim31.maven
                                    </groupId>
                                    <artifactId>
                                        yuicompressor-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.1,)
                                    </versionRange>
                                    <goals>
                                        <goal>compress</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute></execute>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
时光磨忆 2024-11-14 00:46:15

也许你必须提供 id 和阶段?

<plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>yuicompressor-maven-plugin</artifactId>
    <version>1.1</version>
    <executions>
        <execution>
            <id>compressyui</id>
            <phase>process-resources</phase>
            <goals>
                <goal>compress</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <jswarn>false</jswarn>
    </configuration>
</plugin>

至少我没有通过此配置收到该消息。

Maybe you have to provide the id and phase?

<plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>yuicompressor-maven-plugin</artifactId>
    <version>1.1</version>
    <executions>
        <execution>
            <id>compressyui</id>
            <phase>process-resources</phase>
            <goals>
                <goal>compress</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <jswarn>false</jswarn>
    </configuration>
</plugin>

At least i don't get that message with this configuration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文