【问题标题】:Maven generated-sources/annotationsMaven 生成源/注释
【发布时间】:2015-09-04 23:53:26
【问题描述】:

嘿,伙计,我花了很多时间研究并没有找到详细的答案,所以我发布了这个问题。目前我在从 AWS Workflow 生成源时遇到问题。我正在使用 Maven apt-maven-pluginaspectj-maven-plugin。这些插件都可以为活动生成客户端类,但在针对我的工作流类运行 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>

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

【问题讨论】:

    标签: java amazon-web-services annotations maven-plugin


    【解决方案1】:

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

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-03
      • 1970-01-01
      • 2010-12-07
      • 2022-12-19
      • 2013-08-01
      • 2012-09-20
      相关资源
      最近更新 更多