Spr*_*ing 62 java intellij-idea maven
在我将IntelliJ版本从12更新到13之后,我在Maven Profile/Project/Plugins上看到错误,说明以下插件无法解决:
org.apache.maven.plugins:maven-clean-plugin:2.4.1
org.apache.maven.plugins:maven-deploy-plugin
org.apache.maven.plugins:maven-install-plugin
org.apache.maven.plugins:maven-site-plugin
Run Code Online (Sandbox Code Playgroud)
当我使用IntelliJ 12时,这些不在我的插件列表中,不知何故它们是在更新后添加的,现在它抱怨它们无法找到,我在哪里可以从列表中删除这些插件或通过安装它们来解决问题?
我可以运行Maven目标clean
并compile
没有问题,但配置文件/插件只是看起来都在红与我不喜欢的警告.
Gar*_*lon 33
我在IntelliJ 14.0.1中遇到了同样的问题我可以通过在IntelliJ的maven设置中启用"使用插件注册表"来解决它.
Jav*_*aru 20
从maven工具窗口运行强制重新导入.如果这不起作用,请使缓存无效(文件>无效缓存)并重新启动.等待IDEA重新索引项目.
oli*_*ejp 17
我遇到过同样的问题。我将插件添加到我的 pom.xml 依赖项中,它对我有用。
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
<type>maven-plugin</type>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<type>maven-plugin</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)
Ste*_*gin 15
我使用maven-deploy插件多年来遇到了这个问题,即使我没有在我的POM中直接包含插件,也出现了错误.作为一个解决方案我不得不强制将插件包含一个版本到我的POM插件部分只是为了删除红色波浪形.
在StackOverflow上尝试每个解决方案后,我发现了问题:查看我的.m2/repository/org/apache/maven/plugins/maven-deploy-plugin目录,有一个版本'XY'和'2.8.2'等人.所以我删除了整个maven-deploy-plugin目录,然后重新导入了我的Maven项目.
所以似乎问题是解析存储库时的IJ错误.我不会删除整个仓库,只是报告错误的插件.
Joh*_*nes 12
我尝试了其他答案,但没有一个为我解决了这个问题。
当我明确添加groupId
这样的问题时,问题就消失了:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)
一旦版本号的颜色从红色变为黑色并且问题从Problems
选项卡中消失,groupId
可以再次从有问题的插件中删除,错误不会再次出现并且版本号甚至显示为version
.
我有同样的错误,并能够通过删除我的旧Maven设置文件摆脱它.然后我使用mvn命令手动更新了Maven插件:
mv ~/.m2/settings.xml ~/.m2/settings.xml.old
mvn -up
Run Code Online (Sandbox Code Playgroud)
最后,我在IntelliJ的Maven项目选项卡中运行了"Reimport All Maven Projects"按钮.在我的案例中,错误消失了.
对我来说,这就像给插件一个版本一样简单:
<version>3.3.0</version>
Run Code Online (Sandbox Code Playgroud)
完整的插件代码示例如下:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
没有其他答案对我有用.对我有用的解决方案是通过cmd手动下载缺失的工件:
mvn dependency:get -DrepoUrl=http://repo.maven.apache.org/maven2/ -Dartifact=ro.isdc.wro4j:wro4j-maven-plugin:1.8.0
Run Code Online (Sandbox Code Playgroud)
解决了 !!!
这就是我解决问题的方式...
再次尝试线程中的答案之一,即“如果不起作用,请使您的缓存无效(文件>无效的缓存)并重新启动。” 做到了,但再次没有运气。
尝试过这些选项..转到设置-> Maven->导入,并确保已选择以下内容
自动导入Maven项目
为聚合器项目创建IDEA模块保留源代码...
排除构建目录...
使用Maven输出...
生成的源文件夹:“自动检测”
将要进行的阶段:“过程资源”
自动下载:“源”和“文档”
使用Maven3导入
导入程序的项目VM选项:-Xmx512m
但是再次没有成功。
这对我有用……删除“C:\Users[Windows 用户帐户].m2\repository”下的所有文件夹和文件。
最后在 IntelliJ 的 Maven 项目选项卡中运行“重新导入所有 Maven 项目”。
如果工件无法解决。进入您的 .m2/repository 目录并检查您是否没有此类文件:
build-helper-maven-plugin-1.10.pom.lastUpdated
如果文件夹中没有任何工件,只需将其删除,然后再次尝试在 IntelliJ 中重新导入。
这些文件的内容如下:
#NOTE: This is an Another internal implementation file, its format can be changed without prior notice.
#Fri Mar 10 10:36:12 CET 2017
@default-central-https\://repo.maven.apache.org/maven2/.lastUpdated=1489138572430
https\://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.codehaus.mojo\:build-helper-maven-plugin\:pom\:1.10 from/to central (https\://repo.maven.apache.org/maven2)\: connect timed out
Run Code Online (Sandbox Code Playgroud)
如果没有 *.lastUpdated 文件,IntelliJ(或者顺便说一下 Eclipse)可以重新加载丢失的内容。
小智 5
我正在使用IntelliJ Ultimate 2018.2.6,发现“ 重新导入所有Maven项目”功能不使用JDK,该JDK在“设置”中设置:“ 构建”,“执行”,“部署” |“部署”。生成工具| Maven | 赛跑者。相反,它IntelliJ_HOME/jre64/
默认使用它自己的JRE 。您可以在“ 构建”,“执行”,“部署” |“配置”中为导入程序配置JDK。生成工具| Maven | 正在导入。
在我的特定问题中,JRE密钥库中缺少SSL证书。不幸的是,IDEA仅将此问题记录在自己的日志文件中。一个小小的红色框告知RuntimeException 非常好...
对我来说,有效的方法是将包含插件的存储库放在pluginRepository 标签下。例子,
<pluginRepositories>
<pluginRepository>
<id>pcentral</id>
<name>pcentral</name>
<url>https://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
78153 次 |
最近记录: |