pom.xml 4.41 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3 4
  <modelVersion>4.0.0</modelVersion>
  <parent>
5 6
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-parent</artifactId>
7
    <version>3.6.1</version>
8
  </parent>
9

10 11
  <artifactId>protobuf-java-util</artifactId>
  <packaging>bundle</packaging>
12 13 14 15

  <name>Protocol Buffers [Util]</name>
  <description>Utilities for Protocol Buffers</description>

16 17
  <dependencies>
    <dependency>
18
      <groupId>${project.groupId}</groupId>
19 20 21 22 23 24
      <artifactId>protobuf-java</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
25 26 27 28 29
    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
      <version>2.3.2</version>
    </dependency>
30 31 32 33 34
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <scope>test</scope>
    </dependency>
35 36 37
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
Bo Yang's avatar
Bo Yang committed
38
      <version>2.7</version>
39 40 41 42 43 44 45 46 47 48 49 50 51 52
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
    </dependency>
  </dependencies>
53 54 55 56 57 58

  <properties>
    <!-- Use the core proto dir so that we can call the core generation script -->
    <test.proto.dir>../core/src/test/proto</test.proto.dir>
  </properties>

59 60 61 62 63
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
64
          <!-- Generate the test protos -->
65 66 67 68
          <execution>
            <id>generate-test-sources</id>
            <phase>generate-test-sources</phase>
            <configuration>
69 70 71 72 73 74
              <target>
                <!-- Generate all of the test protos from the core module -->
                <ant antfile="../core/generate-test-sources-build.xml"/>

                <!-- Generate additional test protos for this module -->
                <exec executable="${protoc}">
75 76 77 78
                  <arg value="--java_out=${generated.testsources.dir}"/>
                  <arg value="--proto_path=${protobuf.source.dir}"/>
                  <arg value="--proto_path=src/test/proto"/>
                  <arg value="src/test/proto/com/google/protobuf/util/json_test.proto"/>
79
                </exec>
80
              </target>
81 82 83 84 85 86 87
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
88

89
      <!-- Add the generated test sources to the build -->
90
      <plugin>
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-generated-test-sources</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${generated.testsources.dir}</source>
              </sources>
            </configuration>
          </execution>
        </executions>
107 108 109
      </plugin>

      <!-- Configure the OSGI bundle -->
110 111 112 113 114 115 116 117
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
            <Bundle-SymbolicName>com.google.protobuf.util</Bundle-SymbolicName>
118
            <Export-Package>com.google.protobuf.util;version=${project.version}</Export-Package>
119 120 121
          </instructions>
        </configuration>
      </plugin>
122 123

      <!-- Configure the fat jar to include all dependencies -->
124
      <plugin>
125 126 127 128 129 130
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
131
      </plugin>
132 133
    </plugins>
  </build>
134
</project>