我正在尝试在ubuntu上构建一个maven项目,但是我得到了一些编译失败,这是我第一次使用Maven,我无法解决这个问题!!!!
[DEBUG] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
除此之外我还得到了一个错误符号
[INFO] Compilation failure
/home/user/oscars_dist1/oscars-0.6-sdk-01.11.11/eomplsPSS/src/main/java/net/es/oscars/pss/eompls/ios/IOSConfigGen.java:[15,28] cannot find symbol
symbol : class DeviceConfigGenerator
location: package net.es.oscars.pss.api
请帮我解决如何解决问题!!!
thgis是pom.xml文件:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>OSCARS</artifactId>
<groupId>net.es.oscars</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>eomplsPSS</artifactId>
<name>Ethernet over MPLS PSS</name>
<properties>
<spring.version>3.2.3.RELEASE</spring.version>
</properties>
<!-- puts all code & libraries in one jar -->
<pluginRepositories>
<pluginRepository>
<id>onejar-maven-plugin.googlecode.com</id>
<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- specific database -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.26</version>
</dependency>
<!-- common SOAP interfaces (from local repository) -->
<dependency>
<groupId>net.es.oscars</groupId>
<artifactId>common-soap</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- OSCARS utilities (from local repository) -->
<dependency>
<groupId>net.es.oscars</groupId>
<artifactId>utils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- OSCARS utilities (from local repository) -->
<dependency>
<groupId>net.es.oscars</groupId>
<artifactId>pss</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.8</version>
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>
<!-- database (from local repository) -->
<dependency>
<groupId>net.es.oscars</groupId>
<artifactId>database</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- issue 93 -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
</dependency>
<!-- configuration -->
<dependency>
<groupId>org.jyaml</groupId>
<artifactId>jyaml</artifactId>
<version>1.3</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
<!-- database for unit tests -->
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
<scope>test</scope>
</dependency>
<!-- command-line parsing -->
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.16</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
<scope>runtime</scope>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- CXF -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- puts all code & libraries in one jar -->
<plugin>
<groupId>org.dstovall</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<configuration>
<mainClass>net.es.oscars.pss.eompls.common.Invoker</mainClass>
<classifier>onejar</classifier>
</configuration>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- specifically use java 1.5 to compile -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
答案 0 :(得分:0)
[INFO] Compilation failure
/home/user/oscars_dist1/oscars-0.6-sdk-01.11.11/eomplsPSS/src/main/java/net/es/oscars/pss/eompls/ios/IOSConfigGen.java:[15,28] cannot find symbol
symbol : class DeviceConfigGenerator
location: package net.es.oscars.pss.api
这意味着你在班级IOSConfigGen.java
中有错误,我很确定你有一个丢失的jar,所以你必须识别它并在Maven Repository
中搜索它并添加它在pom.xml
中,或者如果你在Maven Repository
找不到他,你必须给他DL并手动安装。
否则,您必须将其添加到Java Build Path
。
希望可以提供帮助。