Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> avro-maven-plugin in eclipse?


Copy link to this message
-
Re: avro-maven-plugin in eclipse?
HI Arun,

I think the default phase for the Avro Maven plugin is generate-sources, so
I'm surprised that doesn't work.  You can always explicitly bind the plugin
to that phase.  This is what I've been using to get my Avro
protocols/schemas compiled and added to the build path, both through the
command line and with the Eclipse plugin: http://pastebin.com/4WgjUW9Z

The Maven Eclipse plugin is buggy, especially when dealing with
generated/added sources.  To get the plugin to execute the generate-sources
phase I usually have to right-click the project, go to the Maven sub-menu,
and then select Update Project Configuration.  Sometimes that will result in
the generated sources getting added to the build path.  If not, you might
have to manually add target/generated-sources/avro to the build path by
going through the project properties.

I'm also not aware of any documentation for the Avro Maven plugin (although
running maven:site on the source would probably generate it), but you can
always look at the plugin source to see what properties it's looking for:
http://svn.apache.org/repos/asf/avro/trunk/lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/AbstractAvroMojo.java

-James
On Tue, Jun 14, 2011 at 2:46 PM, Arun Ramakrishnan <
[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]>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]> 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
>>
>>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB