exec-maven-plugin不使用第三方回购

时间:2014-07-28 03:43:02

标签: maven exec-maven-plugin

我配置了几个第三方存储库。我知道他们已经正确配置,因为它从他们那里下载了工件。但exec-maven-plugin似乎无法识别这些第三方回购。它寻找它在Maven Central中的依赖性,然后告诉我POM在那里不存在。当然它并没有;它在第三方回购中!我是否需要做一些特别的事情来告诉exec-maven-plugin使用第三方存储库?

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <id>emulation</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
                <mainClass>krum.jplex.JPlex</mainClass>
                <arguments>
                    <argument>${basedir}/src/main/jplex/EmulationLexer.jplex</argument>
                    <argument>${project.build.directory}/generated-sources/jplex</argument>
                    <argument>${project.build.directory}/generated-resources/jplex</argument>
                </arguments>
                <sourceRoot>${project.build.directory}/generated-sources/jplex</sourceRoot>
                <includePluginDependencies>true</includePluginDependencies>
                <classpathScope>compile</classpathScope>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>com.chalcodes.jplex</groupId>
            <artifactId>JPlex</artifactId>
            <version>1.2.1</version>
        </dependency>
    </dependencies>
</plugin>

1 个答案:

答案 0 :(得分:0)

读取Using Plugin Dependencies instead of Project Dependencies表示您需要指定以下内容(除了您拥有的内容)

<configuration>
      <includeProjectDependencies>false</includeProjectDependencies>
      <includePluginDependencies>true</includePluginDependencies>
      <executableDependency>
        <groupId>com.chalcodes.jplex</groupId>
        <artifactId>1.2.1</artifactId>
      </executableDependency>
...
</configuration