pom.xml 4.67 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.11.0-rc-0</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
    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
28
      <version>2.3.3</version>
29
    </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>
38
      <version>2.8.6</version>
39 40 41 42 43 44 45 46 47 48 49 50 51
    </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>
Hao Nguyen's avatar
Hao Nguyen committed
52 53 54 55 56
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <scope>test</scope>
    </dependency>
57
  </dependencies>
58 59 60 61 62 63

  <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>

64 65 66 67 68
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
69
          <!-- Generate the test protos -->
70 71 72 73
          <execution>
            <id>generate-test-sources</id>
            <phase>generate-test-sources</phase>
            <configuration>
74 75 76 77 78 79
              <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}">
80 81 82 83
                  <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"/>
84
                </exec>
85
              </target>
86 87 88 89 90 91 92
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
93

94
      <!-- Add the generated test sources to the build -->
95
      <plugin>
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
        <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>
112 113 114
      </plugin>

      <!-- Configure the OSGI bundle -->
115 116 117 118 119 120
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
121
            <Automatic-Module-Name>com.google.protobuf.util</Automatic-Module-Name> <!-- Java9+ Jigsaw module name -->
122 123
            <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
            <Bundle-SymbolicName>com.google.protobuf.util</Bundle-SymbolicName>
124
            <Export-Package>com.google.protobuf.util;version=${project.version}</Export-Package>
125 126 127
          </instructions>
        </configuration>
      </plugin>
128 129

      <!-- Configure the fat jar to include all dependencies -->
130
      <plugin>
131 132 133 134 135 136
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
137
      </plugin>
138 139
    </plugins>
  </build>
140
</project>