找不到 aspectj-maven-plugin 的依赖项 [英] Could not find dependencies for aspectj-maven-plugin

查看:37
本文介绍了找不到 aspectj-maven-plugin 的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 aspectj-maven-plugin 时遇到 CTW 方面的问题.我收到以下错误(正在突出显示执行条目):

I have a problem with CTW aspects using aspectj-maven-plugin. I get the following error (execution entry is being highlighted):

Multiple annotations found at this line:
    - Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.5:compile failed: Plugin 
     org.codehaus.mojo:aspectj-maven-plugin:1.5 or one of its dependencies could not be resolved: Could not find artifact 
     com.sun:tools:jar:1.7.0_21 at specified path C:\Program Files\Java\jre7/../lib/tools.jar (org.codehaus.mojo:aspectj-maven-
     plugin:1.5:compile:default:compile)
    - Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.5:test-compile failed: Plugin 
     org.codehaus.mojo:aspectj-maven-plugin:1.5 or one of its dependencies could not be resolved: Could not find artifact 
     com.sun:tools:jar:1.7.0_21 at specified path C:\Program Files\Java\jre7/../lib/tools.jar (org.codehaus.mojo:aspectj-maven-
     plugin:1.5:test-compile:default:test-compile)

关于配置:

<build>
        <plugins>
            <!-- http://mojo.codehaus.org/aspectj-maven-plugin/usage.html -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <showWeaveInfo>true</showWeaveInfo>
                    <outxml>true</outxml>
                    <source>1.7</source>
                    <target>1.7</target>
                    <sources>
                        <source>
                            <basedir>src/main/java</basedir>
                            <includes>
                                <include>**/*Aspect.java</include>
                            </includes>
                        </source>
                    </sources>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

我做错了什么?好像这个插件找不到jdk?但为什么?

What am I doing wrong? It looks like as if this plugin was unable to find jdk? But why?

推荐答案

我在使用 java 11 时遇到了这个问题,似乎它只与 java 8 兼容.

I had this problem running with java 11, seems like it is only compatible with java 8.

查看项目,aspectj-maven-plugin 看起来更新已提交但从未真正合并.

Looking into the project, aspectj-maven-plugin it looks like the update was committed but never actually merged.

这篇关于找不到 aspectj-maven-plugin 的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆