【发布时间】:2015-06-12 15:16:35
【问题描述】:
我必须同时包含 pom.xml 的项目,比如说项目 A 和项目 B。在项目 B 中,我在其 pom.xml 中添加了项目 A 作为依赖项。在项目 A 中有一个类 Mirror.java,在这个类中我添加了方法,然后通过右键单击它并更新项目来更新项目 B,以便使用新代码更新项目 A 的 jar。现在,当我尝试调用此方法时,它在项目 B 中不可见,尽管 Maven 依赖项中的 .class 文件包含新方法
项目 B pom.xml
<dependency>
<groupId>com.intel.imc.swa.jetdb</groupId>
<artifactId>mirror</artifactId>
<version>0.1.4</version>
</dependency>
Project B Test.class
new Mirror(db.getConnectionString(), "EABase_JET4_empty.eap",eap.getAbsolutePath()).webrun();
Project A Mirror.java
public Mirror(String source, String template, String target) throws SQLException, IOException {
this.sourceString=source;
this.templateFileString=template;
this.targetFileString=target;
}
public void webrun() {
System.out.print("test");
}
为什么项目 B 中没有 webrun 方法?
谢谢
【问题讨论】:
标签: java maven dependencies maven-plugin