【问题标题】:Why am I not able to see the source code of my maven plugin in intellij?为什么我在 intellij 中看不到我的 maven 插件的源代码?
【发布时间】:2018-03-11 08:01:39
【问题描述】:

我正在开发一个新的 Maven 插件。我已将正在开发的插件包含在另一个项目的 pom.xml 中以进行测试。我正在使用 intellij idea 作为我的 IDE。问题是我无法从我的测试项目导航到我的插件源文件。该项目正在编译,我可以访问其他依赖库的源代码,但无法访问任何 maven 插件。如何解决这个问题?以下是我在测试项目中配置插件的方式。

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

        <plugins>
            <plugin>
                <groupId>my.package</groupId>
                <artifactId>my-maven-plugin</artifactId>
                <version>0.0.123-SNAPSHOT</version>
                <dependencies>
                    <dependency>
                        <groupId>my.package</groupId>
                        <artifactId>my-custom-plugin-add-on</artifactId>
                        <version>0.0.123-SNAPSHOT</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>my-check</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>mygoal</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

</build>

【问题讨论】:

  • 向我们展示测试项目的 pom?
  • @EngineerDollery 我已添加 pom 以供参考。

标签: maven intellij-idea maven-plugin


【解决方案1】:

我终于能够通过为我要测试的项目和插件项目提供一个通用的超级 pom.xml 来解决它。

Parent Project
   - The Project using maven plugin. (with the plugin added to the package phase)
   - The maven plugin itself.

然后我将使用 maven 插件右键单击项目的“包”maven 生命周期阶段并选择调试。

【讨论】:

    猜你喜欢
    • 2021-04-09
    • 1970-01-01
    • 2011-01-11
    • 2013-11-13
    • 2011-06-25
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 2020-12-21
    相关资源
    最近更新 更多