다음 명령을 사용하여 Lumify 프로젝트를 빌드하려고 합니다.
mvn package -e -P web-war -pl web/war -am -DskipTests -Dsource.skip=true
다음과 같은 컴파일 오류가 발생합니다.
[INFO] Lumify ............................................ SUCCESS [1.818s]
[INFO] Lumify: Web ....................................... SUCCESS [0.051s]
[INFO] Lumify: Web: Client API ........................... SUCCESS [1.676s]
[INFO] Lumify: Core ...................................... SUCCESS [0.053s]
[INFO] Lumify: Core: Core ................................ SUCCESS [2.755s]
[INFO] Lumify: Core: Plugins ............................. SUCCESS [0.048s]
[INFO] Lumify: Core: Plugin: Model: BigTable ............. SUCCESS [1.888s]
[INFO] Lumify: Core: Plugin: Model: RabbitMQ ............. SUCCESS [0.883s]
[INFO] Lumify: Core: Plugin: Model: Secure Graph ......... SUCCESS [14.303s]
[INFO] Lumify: Web: Base ................................. FAILURE [12.883s]
[INFO] Lumify: Web: War .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.403s
[INFO] Finished at: Wed Mar 08 22:59:18 PST 2017
[INFO] Final Memory: 49M/145M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project lumify-web: Compilation failure: Compilation failure:
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/routes/admin/AdminUploadOntology.java:[76,48] cannot find symbol
[ERROR] symbol: method getParts()
[ERROR] location: variable request of type javax.servlet.http.HttpServletRequest
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/routes/config/Plugin.java:[39,33] cannot find symbol
[ERROR] symbol: method getServletContext()
[ERROR] location: variable request of type javax.servlet.http.HttpServletRequest
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/routes/Index.java:[50,85] cannot find symbol
[ERROR] symbol: method getServletContext()
[ERROR] location: variable request of type javax.servlet.http.HttpServletRequest
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/routes/vertex/VertexImport.java:[99,33] cannot find symbol
[ERROR] symbol: method getParts()
[ERROR] location: variable request of type javax.servlet.http.HttpServletRequest
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/routes/vertex/VertexUploadImage.java:[96,60] cannot find symbol
[ERROR] symbol: method getParts()
[ERROR] location: variable request of type javax.servlet.http.HttpServletRequest
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/ApplicationBootstrap.java:[140,54] cannot find symbol
[ERROR] symbol: method addServlet(java.lang.String,io.lumify.web.Router)
[ERROR] location: variable context of type javax.servlet.ServletContext
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/ApplicationBootstrap.java:[151,54] cannot find symbol
[ERROR] symbol: method addServlet(java.lang.String,java.lang.Class<org.atmosphere.cpr.AtmosphereServlet>)
[ERROR] location: variable context of type javax.servlet.ServletContext
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/ApplicationBootstrap.java:[152,16] cannot find symbol
[ERROR] symbol: method addListener(java.lang.Class<org.atmosphere.cpr.SessionSupport>)
[ERROR] location: variable context of type javax.servlet.ServletContext
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/ApplicationBootstrap.java:[169,52] cannot find symbol
[ERROR] symbol: method addFilter(java.lang.String,java.lang.Class<io.lumify.web.RequestDebugFilter>)
[ERROR] location: variable context of type javax.servlet.ServletContext
[ERROR] /home/ziontest/lumify/lumify/web/web-base/src/main/java/io/lumify/web/ApplicationBootstrap.java:[175,52] cannot find symbol
[ERROR] symbol: method addFilter(java.lang.String,java.lang.Class<io.lumify.web.CacheServletFilter>)
[ERROR] location: variable context of type javax.servlet.ServletContext
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project lumify-web: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :lumify-web
pom 파일에 javax-servlet-api 3.1.0 종속성을 추가했습니다. 내 Java 버전은 Java 7입니다.JAVA_HOME =/usr/lib/jvm/java-7-openjdk-amd64
계속해서 이 오류가 발생합니다. 가능한 한 빨리 이 문제를 해결하도록 도와주세요.
참고: 우분투에서 터미널을 통해 프로젝트를 구축하고 있습니다. 나는 IDE를 사용하지 않습니다
답변1
나는 이것이 의존성 문제라고 생각합니다. 사용해 보시기 바랍니다mvn 새로 설치
난 자주 그래mvn clean install -e -U -Dmaven.test.skip=true