我一直在尝试使用maven构建代码。但我有一个错误。该代码可在此github repo上获得。谷歌游戏爬虫
maven显示的我的系统配置如下:
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
Maven home: /Users/tushar/Downloads/apache-maven-3.0.5
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"
以下是错误的Maven跟踪:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project googleplaycrawler: Compilation failure -> [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 googleplaycrawler: 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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:862)
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]
[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。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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.akdeniz</groupId>
<artifactId>googleplaycrawler</artifactId>
<version>0.3</version>
<packaging>jar</packaging>
<name>Google Play Crawler</name>
<url>https://github.com/Akdeniz/google-play-crawler</url>
<description>Play with Google Play API :)</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.argparse4j</groupId>
<artifactId>argparse4j</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-cache</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>protoc-plugin</id>
<url>http://sergei-ivanov.github.com/maven-protoc-plugin/repo/releases/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<fork>true</fork
<executable>${JAVA_1_7_HOME}/bin/javac</executable>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>attached</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.akdeniz.googleplaycrawler.cli.googleplay</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.protobuf.tools</groupId>
<artifactId>maven-protoc-plugin</artifactId>
<version>0.3.1</version>
<configuration>
<protocExecutable>protoc</protocExecutable>
<protoSourceRoot>${project.basedir}/src/main/protobuf/</protoSourceRoot>
<languageSpecifications>
<LanguageSpecification>
<language>JAVA</language>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
</LanguageSpecification>
</languageSpecifications>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我得到了类似的错误,最终发现只是清理构建文件夹解决了我的问题。
mvn clean install
对于我的情况,我将fork的值切换为false,例如
你的Maven正在读取Java版本为1.6。0_65,正如pom.xml所说的版本是1.7。
尝试安装所需的verison。
如果已经安装了检查您的$JAVA_HOME环境变量,它应该包含JDK 7Java路径。如果你没有找到它,修复你的环境变量。
同时拆下管路
<fork>true</fork>
<executable>${JAVA_1_7_HOME}/bin/javac</executable>
从pom。xml
我有一个maven项目,它是从git回购复制到我的eclipse上的。它是基于Java8构建的。我要做的第一件事就是做一个 但我收到以下失败信息: 以及汇编设置: 无论我构建项目多少次,我都会得到相同的错误。即使在清理项目并从eclipse中刷新它之后也没有帮助。请导游。 更新: 在添加属性以设置maven编译器插件之后 , 我得到以下错误: 下面是给出MainUITabbed类编译错误的代码片段
当我运行intellij idea maven安装时,它遇到了如下问题 无法执行目标组织。阿帕奇。专家插件:maven编译器插件:3.8.1:testCompile 如何解决?
我知道这是一个重复的问题,但其他话题的答案对我没有帮助。 我使用的是Eclipse光子,Java版本:10,我在Eclipse和pom中将jdk/jre版本设置为10。xml文件。我已经改变了。ini文件: -dosgi.requiredJavaVersion=10(设置为1.8) 我还在我的pom中添加了插件。xml: 没有任何帮助。这是我的pom。xml: 这些依赖项没有在类文件中读取,我也尝
无法执行目标org.apache.maven.plugins: maven-compiler-plugin: 3.1:编译(默认编译)在Jenkins构建中的项目与错误消息 [INFO]——maven编译器插件:3.1:compile(默认编译)@projectname---- [INFO]检测到更改-重新编译模块 [INFO]将21个源文件编译为C:\Program files(x86)\Jen
来自Eclipse火星版,pom。xml-Run-As-maven-clean,我得到了以下关于构建失败的错误消息 [ERROR]无法执行目标组织。阿帕奇。专家插件:maven clean插件:2.5:项目测试框架上的clean(默认清洁):目标组织的执行默认清洁。阿帕奇。专家插件:maven clean插件:2.5:clean失败:插件组织。阿帕奇。专家plugins:maven clean p
我正在做一个端到端的项目,包括后端和前端。前端工作正常(angular2框架、“npm启动”和“ng构建”工作正常)。但是,当我从project home文件夹运行“mvn clean install”时,它会给我一个错误,我对此一无所知: 在project home文件夹下,我可以成功运行“mvn compile”,但不能运行“mvn clean install”。它显示前端故障,并显示上面的错