加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 继续开发插件

发布时间:2020-12-14 05:08:59 所属栏目:Java 来源:网络整理
导读:有一个由Maven管理的 Eclipse插件,其中包含以下配置: project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/ma
有一个由Maven管理的 Eclipse插件,其中包含以下配置:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>wonttellya</groupId>
        <artifactId>wonttellya</artifactId>
        <version>1.0-SNAPSHOT</version>
        <packaging>jar</packaging>
        <dependencies>
            ...
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.10</version>
                <configuration>
                    <pde>true</pde>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

在控制台我运行

C:Usersusergitwonttellyamvn 
         eclipse:eclipse -Declipse.workspace=C:Usersuserworkspace2
...
Using Eclipse Workspace: C:Usersuserworkspace2    
...
BUILD SUCCESS

如果我在工作空间中打开Eclipse,没有项目.

解决方法

首先,你必须明白,maven-eclipse-plugin的目的是引用其文档:

to generate Eclipse IDE files (*.classpath,*.project,*.wtpmodules and the .settings folder) for use with a project.

其目标不是创建一个整个项目,而是建立Eclipse阻止现有项目.

PDE支持也是如此. Quoting its documentation:

Note that the scope of the maven-eclipse-plugin is to synchronise the Eclipse .project and .classpath files with the configuration found in the pom file. Once you have finished configuring the Eclipse plugin as below,and once you have run the eclipse:eclipse goal,you will be in a position to build your plugin code with the Eclipse IDE,or the Eclipse headless PDE build. The Eclipse headless PDE build can be triggered from within Maven using the pde-maven-plugin.

因此,您只需简单地为现有项目创建正确的.project和.classpath文件即可.一旦这个配置已经完成,eclipse:eclipse目标运行,你将需要按照下列步骤:

>打开Eclipse并导入现有项目,转到“文件>导入…>现有项目进入工作区”.
>右键单击新项目,然后选择“配置>转换为插件项目…”.确认此选择.

然后,您可以直接在IDE中构建Eclipse插件.

请注意,我不建议使用此解决方案,我建议您使用Tycho,这可能是您可以对此插件进行改进(请参阅this question).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读