To configure the source and destination directories, it looks something like:
      <plugin>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro-maven-plugin</artifactId>
        <version>1.5.1</version>
        <executions>
          <execution>
            <id>schemas</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>schema</goal>
            </goals>
            <configuration>
              <sourceDirectory>src/main/schemata/avro</sourceDirectory>
              <outputDirectory>target/generated-sources/avro</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

(which does only *.avsc via the schema goal)

https://cwiki.apache.org/confluence/display/AVRO/Build+Documentation

Covers the Avro build, and similar works for me in other projects.

In particular, it seems as though one must do the "Maven > Update Project 
Configuration" step on a maven project to get it to add source directories 
generated by plugins.

I usually do "Import ….   Existing Maven Project"  Followed immediately by 
"Maven > Update Project Configuration" on the project.



On 6/14/11 11:46 AM, "Arun Ramakrishnan" 
<[email protected]<mailto:[email protected]>> wrote:

>From the command line
"mvn avro:idl-protocol" finds my avdl files from src/main/avro and compiles it 
to the build directory.

But, generate-sources ( command line or eclipse ) dosent seem to triger it. Am 
I missing something in the plugin configuration to integrate this into the 
generate-sources step.
Also, what are the various config values ( if i want to change the default 
source, target directories etc ). I cant seem to find any docs on it.



<plugin>

<groupId>org.apache.avro</groupId>

<artifactId>avro-maven-plugin</artifactId>

<version>1.5.1</version>

</plugin>

I have the m2eclipse plugin too.

On Wed, May 25, 2011 at 4:44 PM, Scott Carey 
<[email protected]<mailto:[email protected]>> wrote:
generate-sources in Eclipse works for me.  (Helios, m2Eclipse plugin).

Sometimes, I have to right click on a project and select "Maven > Update
Project Configuration" to get it to generate the sources.  It doesn't
automatically run generate-sources if you change a schema file, but a
project clean will trigger it for me.



On 5/25/11 2:54 PM, "Yang" 
<[email protected]<mailto:[email protected]>> wrote:

>it seems that eclipse can't run the generate-sources phase, so that I
>have to
>do 'mvn generate-sources" outside of eclipse, and then import the
>sources from eclipse.
>
>is there a better way to integrate with eclipse?
>
>Thanks
>Yang


Reply via email to