java maven编译错误:找不到符号 [英] java maven COMPILATION ERROR : cannot find symbol

查看:161
本文介绍了java maven编译错误:找不到符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java maven编译错误:找不到符号
我正在使用eclipse从远程linux机器上构建Java maven项目。我使用Eclipse远程系统资源管理器(RSE)连接到项目。当我要全新安装项目时,似乎maven找不到我的某些类。

java maven COMPILATION ERROR : cannot find symbol I am using eclipse to build a java maven project from a remote linux machine. I get connected to project using Eclipse Remote System Explorer (RSE). When I want to clean install the project, it seems that maven cannot find some of my classes.

这是错误,我是项目POM文件。

This is the error and I the project POM file.

错误:

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ rule_miner ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\pita\eclipse-workspace\RemoteSystemsTempFiles\192.168.45.102\home\ubuntu\newRR\rudik\target  classes

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/pita/eclipse-workspace/RemoteSystemsTempFiles/192.168.45.102/home/ubuntu/newRR/rudik/src/main/java/asu/edu/rule_miner/rudik/model/horn_rule/HornRule.java:[13,32] cannot 
find symbol
  symbol:   class RuleMinerException
  location: package asu.edu.rule_miner.rudik
[ERROR] /C:/Users/pita/eclipse-workspace/RemoteSystemsTempFiles/192.168.45.102/home/ubuntu/newRR/rudik/src/main/java/asu/edu/rule_miner/rudik/model/horn_rule/HornRule.java:[14,46] package 
asu.edu.rule_miner.rudik.configuration does not exist
....
....
....
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, 
please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

POM :

<build>

    <!-- Plugin management -->
    <pluginManagement>

        <plugins>
            <!-- Configure the SSH/SCP connector -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>

        </plugins>

    </pluginManagement>

    <!-- Plugins used to modify build-lifecycle behaviour -->
    <plugins>

        <!-- Generate and install source, bound to verify phase, it is active 
            in case of install and deploy -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.1.2</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jar-no-fork</goal>
                        <goal>test-jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <!-- Generate javadoc, bound to deploy phase -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8.1</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <!-- Forces the compiler to 1.8 (source and target) -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <!-- Site generation plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.3</version>
            <configuration>

                <reportPlugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.7</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>dependencies</report>
                                    <report>project-team</report>
                                    <report>license</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>

                        <reportSets>
                            <reportSet>
                                <id>default</id>
                                <reports>
                                    <report>javadoc</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </reportPlugins>
            </configuration>
        </plugin>

    </plugins>
</build>


推荐答案

类似


asu.edu.rule_miner.rudik.configuration

asu.edu.rule_miner.rudik.configuration

不在您的课程中路径。将依赖项添加到pom或检查类是否可访问。

is not in your class path. Add the dependency to you pom or check if class is accessible.

这篇关于java maven编译错误:找不到符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆