Maven Wire Plugin

(Resurrected) Wire Java Code Generation Maven Plugin.

License

License

Categories

Categories

Maven Build Tools Wire Data Data Structures
GroupId

GroupId

de.m3y.maven
ArtifactId

ArtifactId

wire-maven-plugin
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven Wire Plugin
(Resurrected) Wire Java Code Generation Maven Plugin.
Project URL

Project URL

https://github.com/marcelmay/wire-maven-plugin
Source Code Management

Source Code Management

https://github.com/marcelmay/wire-maven-plugin

Download wire-maven-plugin

How to add to project

<plugin>
    <groupId>de.m3y.maven</groupId>
    <artifactId>wire-maven-plugin</artifactId>
    <version>1.1</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
com.squareup : javapoet jar 1.11.1
com.squareup.wire : wire-schema jar 3.2.2
com.squareup.wire : wire-java-generator jar 3.2.2
org.apache.maven : maven-plugin-api jar 3.5.4
org.apache.maven : maven-core jar 3.5.4
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5.2

test (1)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

Wire Maven Plugin

The wire-maven-plugin wraps the Wire protobuf compiler.

Apache License, Version 2.0, January 2004 Maven Central

This is a (resurrected) fork of the original plugin by the Wire project, which dropped this plugin.

What is it good for?

  • Integrates the Wire Protobuf compiler in your Maven project
  • Supports Java code generator
  • Kotlin code generator is on the TODO list

Check out the plugin web site including usage for details for Maven goal generate-sources.

Quickstart

  1. Put your ProtoBuf definition in src/main/proto

  2. Configure plugin in pom.xml

    <build>
      ...
      <plugins>
    
        <plugin>
          <groupId>de.m3y.maven</groupId>
          <artifactId>wire-maven-plugin</artifactId>
          <version>1.0</version> <!-- Check for latest version! -->
          <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>generate-sources</goal>
                </goals>
            </execution>
          </executions>
        </plugin>
    
      </plugins>
    </build>
  3. Add Wire runtime dependency in pom.xml (required by Wire compiler generated sources)

    <dependency>
       <groupId>com.squareup.wire</groupId>                                                                                             
       <artifactId>wire-runtime</artifactId>                                                                                            
       <version>3.2.2</version> <!-- Check for latest version -->
    </dependency>

See the integration test if you look for a working example, check out the generate-sources goal documentation and have a look at the Wire project docs.

Development

  • Build the plugin

    mvn clean install

    Make sure you got Maven 3.6+ or higher.

  • Build the site

    mvn site -Psite or mvn site-deploy -Psite

  • Release

    mvn release:prepare
    mvn release:perform
    
  • Deploy snapshot

    mvn clean deploy -Prelease

    Note: The release profile contains the snapshot repository for distribution management

Versions

Version
1.1
1.0