简体   繁体   中英

java maven COMPILATION ERROR : cannot find symbol

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.

This is the error and I the project POM file.

Error:

[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>

Looks like

asu.edu.rule_miner.rudik.configuration

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM