Advertisement
Guest User

maven protobuf

a guest
Jun 20th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.81 KB | None | 0 0
  1. <build>
  2.         <plugins>
  3.             <plugin>
  4.                 <groupId>org.apache.maven.plugins</groupId>
  5.                 <artifactId>maven-compiler-plugin</artifactId>
  6.             </plugin>
  7.             <plugin>
  8.                 <groupId>org.apache.maven.plugins</groupId>
  9.                 <artifactId>maven-resources-plugin</artifactId>
  10.                 <version>2.6</version>
  11.                 <configuration>
  12.                     <encoding>UTF-8</encoding>
  13.                 </configuration>
  14.                 <executions>                    
  15.                     <execution>
  16.                         <!--We need to overwrite the default-resources execution
  17.                        to run in the generate-sources phase otherwise the proto
  18.                        plugin runs and there are no files to compile.-->
  19.                         <id>default-resources</id>
  20.                         <goals>
  21.                             <goal>resources</goal>
  22.                         </goals>  
  23.                         <phase>generate-sources</phase>
  24.                     </execution>
  25.                 </executions>
  26.             </plugin>
  27.             <plugin>
  28.                 <groupId>com.google.protobuf.tools</groupId>
  29.                 <artifactId>maven-protoc-plugin</artifactId>
  30.                 <version>0.3.2</version>
  31.                 <configuration>
  32.                     <!-- This protocExecutable is empty so each dev must have the protoc executable on their path.-->
  33.                     <protocExecutable></protocExecutable>
  34.                     <!-- This is the dir where the resources plugin drops the replaced .proto files.-->
  35.                     <protoSourceRoot>target/classes</protoSourceRoot>
  36.                 </configuration>
  37.                 <executions>
  38.                     <execution>
  39.                         <goals>
  40.                             <goal>compile</goal>
  41.                         </goals>                        
  42.                     </execution>
  43.                 </executions>
  44.             </plugin>
  45.         </plugins>        
  46.         <resources>
  47.             <resource>
  48.                 <directory>src/main/proto</directory>
  49.                 <filtering>true</filtering>
  50.                 <includes>
  51.                     <include>**/*.proto</include>
  52.                 </includes>
  53.             </resource>
  54.         </resources>
  55.     </build>
  56.  
  57.     <dependencies>
  58.         <dependency>
  59.             <groupId>com.google.protobuf</groupId>
  60.             <artifactId>protobuf-java</artifactId>
  61.             <version>2.5.0</version>
  62.         </dependency>
  63.     </dependencies>
  64.    
  65.     <profiles>
  66.         <profile>
  67.             <id>server</id>
  68.             <properties>
  69.                 <proto.optimize_for>SPEED</proto.optimize_for>
  70.             </properties>
  71.             <activation>
  72.                 <activeByDefault>true</activeByDefault>
  73.             </activation>
  74.         </profile>
  75.         <profile>
  76.             <id>client</id>
  77.             <properties>
  78.                 <proto.optimize_for>LITE_RUNTIME</proto.optimize_for>
  79.             </properties>
  80.             <build>
  81.                 <pluginManagement>
  82.                     <plugins>
  83.                         <plugin>
  84.                             <groupId>org.apache.maven.plugins</groupId>
  85.                             <artifactId>maven-compiler-plugin</artifactId>
  86.                             <version>3.1</version>
  87.                             <configuration>
  88.                                 <source>1.6</source>
  89.                                 <target>1.6</target>
  90.                                 <encoding>${project.build.sourceEncoding}</encoding>
  91.                             </configuration>
  92.                         </plugin>                    
  93.                     </plugins>
  94.                 </pluginManagement>
  95.             </build>  
  96.         </profile>
  97.     </profiles>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement