English 中文(简体)
Change output directory for apt-maven-plugin
原标题:

I am using apt-maven-plugin to process some Beehive Netui annotations before building a war.

The output of the apt processing is a _pageflow directory which contains struts config files (xml text) and the like. The problem is that it is being output in whatever directory I run maven from, not in the ${project.build.directory}/classes directory which is what I want. I tried setting the outputDirectory and the resourceTargetPath properties, but neither changed this behavior.

Is there another parameter to set that I m missing?

Here s my current plugin configuration.

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>apt-maven-plugin</artifactId>
      <version>1.0-alpha-3</version>
      <inherited>false</inherited>
      <configuration>
        <outputDirectory>${project.build.directory}/classes</outputDirectory>
        <options>
          <option>web.content.root=${project.build.directory}/classes</option>
        </options>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>process</goal>
          </goals>
        </execution>
      </executions>
      <dependencies>
        <dependency>
          <groupId>weblogic</groupId>
          <artifactId>beehive-netui-compiler</artifactId>
          <version>${weblogic-version}</version>
        </dependency>
      </dependencies>
    </plugin>
  </plugins>
</build>
最佳回答

Your problem really looks like MOJO-1478 (are you using a Mac)? Maybe have a look at the patch (and reopen the issue or create a new one).

PS: Don t you have to configure a factory? I don t get how the beehive-netui-compiler dependency is used here. Is the factory magically picked up from that dependency just because you specified it?

问题回答

i have same problem with apt-maven-plugin outputDirectory is ignored in mine maven project default value (plugin documentation) (${project.build.directory}/classes) is ignored too. source are generated in root of my project instead of the requested outputDirectory...

for your PS :

if factory is not specified in plugin configuration, it use standard sun feature, create following text file in your src/main/resources folder :

META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory

this file have to contain the full class name of the factory, apt command use it

regards





相关问题
Derby gets stuck closing?

I ve got unit tests (in maven) that use derby. At the end of the test run, there is a very long pause, with these log messages before the pause. INFO: Closing Hibernate SessionFactory Nov 16, 2009 8:...

Execute goal on parent after children complete

I have a multi-module maven project (several levels of nesting). Normally, when I execute a maven build (like mvn install or whatever), maven will run all the goals for the parent project before ...

Including dependencies in a jar with Maven

Is there a way to force maven(2.0.9) to include all the dependencies in a single jar file? I have a project the builds into a single jar file. I want the classes from dependencies to be copied into ...

Java Equivalent of distcc

Distcc makes it easy to distribute a C or C++ compile job across a number of machines, and is a godsend for working with large, frequently-built codebases. An increasing number of our large projects ...

Maven Assembly Problem

I have a maven multiple-module project, which is giving me headaches in the assembly:assembly phase. I have a module which has an assembly defined in it which works fine when I invoke mvn assembly:...

热门标签