gpt4 book ai didi

java - Maven 生成的源/注释

转载 作者:行者123 更新时间:2023-11-30 08:09:33 26 4
gpt4 key购买 nike

嘿伙计,我花了很多时间研究但没有找到详细的答案,所以我发布了这个问题。目前我在从 AWS Workflow 生成源时遇到问题。我正在使用 Maven apt-maven-pluginaspectj-maven-plugin。这些插件都可以为 Activity 生成客户端类,但在针对我的工作流类运行 mvn clean packagemvn clean install 时失败并出现以下错误。
错误

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-
plugin:1.7:compile (default) on project (myproject): Execution default
of goal org.codehaus.mojo:aspectj-maven-plugin:1.7:compile failed:
basedir (myproject)\target\generated-sources\annotations does not exist
-> [Help 1]

插件

            <groupId>org.codehaus.mojo</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0-alpha-5</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-flow-build-tools</artifactId>
</aspectLibrary>
</aspectLibraries>
<complianceLevel>1.7</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<sources>
<source>
<basedir>${basedir}/target/generated-sources/annotations</basedir>
</source>
<source>
<basedir>src/main/java</basedir>
<includes>
<include>**/*.java</include>
</includes>
</source>
</sources>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>

我不确定如何着手解决这个问题,任何帮助都会很棒。

最佳答案

错误消息很明确——mvn 找不到/target/generated-sources/annotations,但在 pom 中它被声明为 aspectj-maven-plugin 的源。

您的代码是否打算在/target/generated-sources/annotations 下生成源代码?如果是,那么生成有问题,您需要公开更多的 pom 以便我告诉您出了什么问题。如果不是,为什么不删除这部分并再试一次。

<source>
<basedir>${basedir}/target/generated-sources/annotations</basedir>
</source>

ps:我宁愿把它作为评论,但我不能:(

关于java - Maven 生成的源/注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32399068/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com