Wire Maven Plugin
The wire-maven-plugin wraps the Wire protobuf compiler.
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
-
Put your ProtoBuf definition in
src/main/proto
-
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>
-
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
ormvn 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