Maven:找不到符号[ERROR]符号:方法

时间:2018-09-28 08:32:21

标签: maven-3 maven-plugin

我有如下所述的多个模块项目

  • 模块A
  • 模块B取决于A
  • 模块C取决于B
  • 继承于模块B测试的模块C测试
  • 模块D取决于模块C
  • 模块D测试取决于C测试(模块C测试取决于模块B)
  

“ mvn全新安装”适用于模块A,B,C,但不适用于模块D   在模块D上出现以下错误

[ERROR]“” /ExceptionTest.java:[38,7]找不到符号

[错误]符号:方法setMethodPath()

我的诗句如下

父pom.xml

git rm --cached <file>

模块B pom.xml

  <dependencyManagement>
        <dependency>
            <groupId>grpid</groupId>
            <artifactId>B</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>grpid</groupId>
            <artifactId>B</artifactId>
            <version>${project.version}</version>
        </dependency>
           declared here Module A, B ,C and thier test-jars
    </dependencies>
</dependencyManagement>
.....
<pluginManagement>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <excludes>

                                <exclude>**/*.bat</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>

模块C pom.xml

 <dependencies>
    <dependency>
        <groupId>grpid</groupId>
        <artifactId>A</artifactId>
    </dependency>

模块D pom.xml

 <dependencies>
    <dependency>
        <groupId>grpid</groupId>
        <artifactId>B</artifactId>
    </dependency>
    <dependency>
        <groupId>grpid</groupId>
        <artifactId>B</artifactId>
        <type>test-jar</type>
        <scope>import</scope> or <scope>test</scope>
    </dependency>

在模块D中,测试类无法从模块B中找到测试类

使用了两个示波器导入或测试,但没有运气。

也尝试过模块C,但是没有运气。

模块D pom.xml

 <dependencies>
    <dependency>
        <groupId>grpid</groupId>
        <artifactId>C</artifactId>
    </dependency>
    <dependency>
        <groupId>grpid</groupId>
        <artifactId>C</artifactId>
        <type>test-jar</type>
        <scope>import</scope> or <scope>test</scope>
    </dependency>

请帮助

已解决

0 个答案:

没有答案