我正在使用Maven 3.0.5和Spring Tool Source 3.2并安装了Maven插件。当我尝试做'Run As ---> Maven安装',我收到以下错误:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Social Twitter4J Sample 1.0.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.maven.plugins:maven-war-plugin:jar:2.1.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ spring-social-twitter4j ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ spring-social-twitter4j ---
[WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Jun 21, 2013 2:14:32 AM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: org.apache.maven.plugin.CompilerMojo
**java.lang.NoClassDefFoundError: org/codehaus/plexus/compiler/CompilerException**
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:98)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:831)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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: java.lang.ClassNotFoundException: org.codehaus.plexus.compiler.CompilerException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 54 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.749s
[INFO] Finished at: Fri Jun 21 02:14:32 IST 2013
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-social-twitter4j: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile: org/codehaus/plexus/compiler/CompilerException**
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/SS%20Computer/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.jar
[ERROR] urls[1] = file:/C:/Users/SS%20Computer/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.compiler.CompilerException
[ERROR] -> [Help 1]
[ERROR]
[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/PluginContainerException
请在下面找到我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>org.springframework.social.samples</groupId>
<artifactId>spring-social-twitter4j</artifactId>
<name>Spring Social Twitter4J Sample</name>
<packaging>war</packaging>
<version>1.0.0</version>
<properties>
<java-version>1.6</java-version>
<org.springframework.social-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social-version>
<org.springframework-version>3.2.1.RELEASE</org.springframework-version>
<org.springframework.security-version>3.1.3.RELEASE</org.springframework.security-version>
<org.slf4j-version>1.7.2</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-web</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<!-- Twitter4J -->
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>2.2.3</version>
</dependency>
<!-- JSR 303 with Hibernate Validator -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.159</version>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- CGLIB, only required and used for @Configuration usage -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>org.springframework.maven.release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<!-- For testing against latest Spring snapshots -->
<repository>
<id>org.springframework.maven.snapshot</id>
<name>Spring Maven Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- For developing against latest Spring milestones -->
<repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warName>spring-social-twitter4j</warName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</build>
</project>
在maven安装期间,我的目标是战争:战争使我的应用程序的WAR。 任何及时的帮助将不胜感激。
答案 0 :(得分:118)
删除完整的.m2/repository
本地存储库解决了我的问题。
否则你需要知道你正在使用哪些插件与它们的依赖关系,因为插件之一在下载时遇到了问题。
答案 1 :(得分:107)
删除完整的.m2本地存储库也解决了我的问题。
如果您不知道它在哪里,则位置为:
Unix/Mac OS X – ~/.m2/repository
Windows – C:\Documents and Settings\{your-username}\.m2\repository
答案 2 :(得分:36)
我正在为@Rushi Shah
添加更多积分 mvn clean install -X
有助于确定根本原因。
Maven构建生命周期的一些重要阶段是:
clean
- 该项目清除了以前编译中的所有工件
compile
- 项目被编译到项目根目录的/ target目录中
install
- 打包存档被复制到本地maven存储库(可以在/.m2下的用户主目录中)
test
- 运行单元测试
package
- 已编译的源被打包到存档(默认为JAR)
1.6 under标签是指JDK版本。 我们需要在dev环境中确保正确的jdk版本或将值更改为 如果该JDK版本可以支持该应用程序,则为1.7或1.5或其他任何内容。
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
我们可以在Maven网站上找到Maven build lifecycle的完整详细信息。
答案 3 :(得分:16)
有时它是由于项目指向JRE而不是JDK引起的。所以试试这个,
1.右键单击项目 - &gt;构建路径 - &gt;配置构建路径 - &gt;添加库 - &gt; JRE系统库 - &gt;环境 - &gt;已安装的JRE - &gt;指向c:drive(Windows)中的java文件夹并选择JDK文件夹并确定。
2.从构建路径中删除已存在的JRE。
答案 4 :(得分:5)
通常,定义maven-compiler-plugin足够了。将以下内容添加到编译器插件定义中。
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
答案 5 :(得分:4)
.m2 / repository
mvn clean verify
),而不是从eclipse运行maven。
答案 6 :(得分:2)
实际上,如果您不想删除本地.m2 / repository / ...并且您从Apache获得了Maven的下载副本,则可以让Eclipse / STS使用该外部Maven,您可以编辑{ maven} \ conf \ settings.xml将localRepository指向一个新的空位置。
<localRepository>C:\java\repository</localRepository>
当然,除了之前的.m2位置之外,您还将拥有一个包含所有maven源代码下载的新存储库。
答案 7 :(得分:2)
其他答案都没有建议下载只是缺少的插件。
在删除整个 .m2 存储库并重新下载所有项目依赖项和所有插件之前,您可能需要尝试:
mvn dependency:resolve-plugins
这将只下载缺少的插件。
答案 8 :(得分:2)
有时会出现此问题,因为您在POM.xml中提到的java.version不是您机器中安装的java.version。
<properties>
<java.version>1.7</java.version>
</properties>
确保您在pom.xml中完全提及与计算机中存在的jdk和jre版本相同的版本。
答案 9 :(得分:1)
我认为你有两种方法来解决这个问题
<强> 01。设置属性
右键单击项目 - &gt; Java构建路径 - &gt;选择库选项卡 - &gt;选择JRE系统库 - &gt;单击编辑按钮 - &gt;单击已安装的JRE-&gt;添加勾选框 - >单击编辑 - &gt;单击目录 - &gt;选择jdk
右键单击项目 - &gt;项目构面 - &gt;勾选java并选择java版本 - &gt;应用 - &gt;确定
右键点击“项目” - &gt;转到Maven-&gt;更新
02.删除.m2文件
如果使用上述两个主题无法解决问题,请执行此操作 关闭你的项目。删除完整的.m2文件夹
如何罚款.m2文件(windows)
转到本地磁盘(C) - &gt;用户 - &gt;选择您的PC名称 - &gt; .m2文件
答案 10 :(得分:1)
可能有一个文件被锁定在 target 文件夹中
答案 11 :(得分:1)
尝试在项目上调用php artisan migrate
时出现此错误。
我在macOS以及Java 8 Update 144上安装了Java 9.Maven项目显然是在调用Java 9并且失败了。从我的Mac中删除了Java 9,只留下了Java 8。 Maven现在正在愉快地建立我的项目以成功完成。
在macOS Sierra上使用Apache Maven 3.5.0。
答案 12 :(得分:1)
对我来说,重新启动Eclipse可以摆脱这个错误!
答案 13 :(得分:1)
答案 14 :(得分:1)
检查endorsed.dir
中的属性pom.xml
标记
我也有这个问题,我修改了属性修复。
示例:
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
答案 15 :(得分:0)
对于Mac OS上的新用户, 找出.m2文件夹并将其删除,它位于 /Users/.m2 目录中。
您无法在finder(文件资源管理器)中看到 .m2 文件夹,对于此用户此命令显示Mac隐藏文件
$ defaults写com.apple.finder AppleShowAllFiles TRUE
在此按下alt并单击finder-&gt;重新启动,您可以看到 /Users/.m2
再次隐藏文件,只需使用它 $ defaults写com.apple.finder AppleShowAllFiles false
答案 16 :(得分:0)
也许您可以将此依赖项添加到您的pom.xml中。我用这种方法来解决问题!
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3.2</version>
</dependency>
答案 17 :(得分:0)
我重命名了.m2目录,这还没有帮助,所以我安装了最新的sdk / jdk并重新启动了eclipse。这很有用。
似乎需要SDK,我只安装了JRE。
这很奇怪,因为eclipse在同一台机器上为不同的旧项目工作。
我导入了第二个maven项目,Run / maven install只在重新启动eclipse后才完成。所以也许只需要重启eclipse即可。
导入另一个项目,即使我已经重启了eclipse,也必须在它工作之前做两次maven install
。
答案 18 :(得分:0)
有必要删除整个.m2 /存储库内容真的很不可思议。 我建议输入此命令(在Windows上):
mvn clean
mvn -X package&gt; my_log_file.log
最后一个命令启用Debug选项并将输出重定向到文件。打开文件并搜索ERROR或WARNING关键字。你可以找到这种表达方式:
DEBUG] =======================================================================
[WARNING] The POM for javax.servlet:javax.servlet-api:jar:4.0.0 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for javax.servlet:javax.servlet-api:4.0.0
[FATAL] Non-parseable POM C:\Users\vifie\.m2\repository\net\java\jvnet-parent\3\jvnet-parent-3.pom: processing instruction can not have PITarget with reserved xml name (position: END_TAG seen ...</profiles>\n\n</project>\n\n<?xml ... @160:7) @ C:\Users\vifie\.m2\repository\net\java\jvnet-parent\3\jvnet-parent-3.pom, line 160, column 7
[WARNING] The POM for org.glassfish:javax.json:jar:1.0.4 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for org.glassfish:javax.json:[unknown-version]
[FATAL] Non-parseable POM C:\Users\vifie\.m2\repository\net\java\jvnet-parent\3\jvnet-parent-3.pom: processing instruction can not have PITarget with reserved xml name (position: END_TAG seen ...</profiles>\n\n</project>\n\n<?xml ... @160:7) @ C:\Users\vifie\.m2\repository\net\java\jvnet-parent\3\jvnet-parent-3.pom, line 160, column 7
在这种情况下,可以理解您只需删除目录C:\ Users \ vifie.m2 \ repository \ net \ java \ jvnet-parent \ 3
重新启动编译,打包等:
mvn package
警告消失只是因为您删除了在正确位置损坏的POM文件并且maven重新下载它。通常新的POM文件更好。
通常,调试模式会为您提供包含更全面详细信息的消息。
为什么我将日志重定向到文件:仅仅因为在Windows控制台上没有足够的缓冲区来存储所有行,并且通常无法看到所有行。
答案 19 :(得分:0)
我们尝试了到目前为止列出的所有内容,但仍然失败了。错误也提到了
项目utilsJava上的(default-war):汇编WAR:webxml时出错 属性是必需的
最终修复它的解决方案是将其添加到POM:
<failOnMissingWebXml>false</failOnMissingWebXml>
如此处Error assembling WAR - webxml attribute is required
所述我们的POM现在包含:
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
答案 20 :(得分:0)
从pom.xml中删除以下代码,或者更正您的Java版本以使其正常工作。
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
答案 21 :(得分:0)
这是因为您的詹金斯无法找到设置文件。如果删除.m2无效,请尝试以下解决方案
转到您的作业配置
而不是“构建”部分
添加构建步骤:-调用顶级Maven目标并填充Maven版本和目标
答案 22 :(得分:0)
这是因为您的Maven无法找到设置文件。如果删除.m2无效,请尝试以下解决方案
转到您的作业配置
而不是“构建”部分
添加构建步骤:-调用顶级Maven目标并填充Maven版本和目标
答案 23 :(得分:0)
就我而言,.properties 文件(Spring Boot 的 application.properties)在某些时候包含一个重音字符。如您所见,它被视为严重错误,因为此 IOUtil.copy 使用 Reader 作为源,因此它在复制时解码字节流,这始终是难以猜测异常的好来源。
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException (CoderResult.java:274)
at sun.nio.cs.StreamDecoder.implRead (StreamDecoder.java:339)
at sun.nio.cs.StreamDecoder.read (StreamDecoder.java:178)
at java.io.InputStreamReader.read (InputStreamReader.java:185)
at java.io.BufferedReader.read1 (BufferedReader.java:210)
at java.io.BufferedReader.read (BufferedReader.java:287)
at java.io.BufferedReader.fill (BufferedReader.java:161)
at java.io.BufferedReader.read (BufferedReader.java:182)
at org.apache.maven.shared.filtering.BoundedReader.read (BoundedReader.java:85)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read (MultiDelimiterInterpolatorFilterReaderLineEnding.java:235)
at org.apache.maven.shared.filtering.MultiDelimiterInterpolatorFilterReaderLineEnding.read (MultiDelimiterInterpolatorFilterReaderLineEnding.java:197)
at java.io.Reader.read (Reader.java:229)
at org.apache.maven.shared.utils.io.IOUtil.copy (IOUtil.java:199)
at org.apache.maven.shared.utils.io.IOUtil.copy (IOUtil.java:181)
at org.apache.maven.shared.utils.io.FileUtils.copyFile (FileUtils.java:1908)
答案 24 :(得分:0)
查看 pom.xml 中的 JDK 版本
<properties>
<java.version>11</java.version>
</properties>
答案 25 :(得分:-1)
我有同样的问题,除了上面的帖子&#39;配置
None
在pom.xml中的plugins元素中。 我认为问题是没有执行 - &gt;目标&#34; endpoints_get_discovery_doc&#34; 在某些情况下像我一样,所以这对我有用。