• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  <modelVersion>4.0.0</modelVersion>
4  <parent>
5    <groupId>com.google.protobuf</groupId>
6    <artifactId>protobuf-parent</artifactId>
7    <version>3.13.0</version>
8  </parent>
9
10  <artifactId>protobuf-java</artifactId>
11  <packaging>bundle</packaging>
12
13  <name>Protocol Buffers [Core]</name>
14  <description>
15    Core Protocol Buffers library. Protocol Buffers are a way of encoding structured data in an
16    efficient yet extensible format.
17  </description>
18
19  <dependencies>
20    <dependency>
21      <groupId>junit</groupId>
22      <artifactId>junit</artifactId>
23      <scope>test</scope>
24    </dependency>
25    <dependency>
26      <groupId>org.easymock</groupId>
27      <artifactId>easymock</artifactId>
28      <scope>test</scope>
29    </dependency>
30    <dependency>
31      <groupId>org.easymock</groupId>
32      <artifactId>easymockclassextension</artifactId>
33      <scope>test</scope>
34    </dependency>
35    <dependency>
36      <groupId>com.google.guava</groupId>
37      <artifactId>guava</artifactId>
38      <scope>test</scope>
39    </dependency>
40    <dependency>
41      <groupId>com.google.truth</groupId>
42      <artifactId>truth</artifactId>
43      <scope>test</scope>
44    </dependency>
45  </dependencies>
46
47  <build>
48    <!-- Include core protos in the bundle as resources -->
49    <resources>
50      <resource>
51        <directory>${protobuf.source.dir}</directory>
52        <includes>
53          <include>google/protobuf/any.proto</include>
54          <include>google/protobuf/api.proto</include>
55          <include>google/protobuf/descriptor.proto</include>
56          <include>google/protobuf/duration.proto</include>
57          <include>google/protobuf/empty.proto</include>
58          <include>google/protobuf/field_mask.proto</include>
59          <include>google/protobuf/source_context.proto</include>
60          <include>google/protobuf/struct.proto</include>
61          <include>google/protobuf/timestamp.proto</include>
62          <include>google/protobuf/type.proto</include>
63          <include>google/protobuf/wrappers.proto</include>
64          <include>google/protobuf/compiler/plugin.proto</include>
65        </includes>
66      </resource>
67    </resources>
68    <testResources>
69      <testResource>
70        <directory>${protobuf.source.dir}</directory>
71        <includes>
72          <include>google/protobuf/testdata/golden_message_oneof_implemented</include>
73          <include>google/protobuf/testdata/golden_packed_fields_message</include>
74        </includes>
75      </testResource>
76    </testResources>
77
78    <plugins>
79      <!-- Use Antrun plugin to generate sources with protoc -->
80      <plugin>
81        <artifactId>maven-antrun-plugin</artifactId>
82        <executions>
83          <!-- Generate core protos -->
84          <execution>
85            <id>generate-sources</id>
86            <phase>generate-sources</phase>
87            <configuration>
88              <target>
89                <ant antfile="generate-sources-build.xml"/>
90              </target>
91            </configuration>
92            <goals>
93              <goal>run</goal>
94            </goals>
95          </execution>
96
97          <!-- Generate the test protos -->
98          <execution>
99            <id>generate-test-sources</id>
100            <phase>generate-test-sources</phase>
101            <configuration>
102              <target>
103                <ant antfile="generate-test-sources-build.xml"/>
104              </target>
105            </configuration>
106            <goals>
107              <goal>run</goal>
108            </goals>
109          </execution>
110        </executions>
111      </plugin>
112
113      <!-- Add the generated sources to the build -->
114      <plugin>
115        <groupId>org.codehaus.mojo</groupId>
116        <artifactId>build-helper-maven-plugin</artifactId>
117        <executions>
118          <execution>
119            <id>add-generated-sources</id>
120            <phase>generate-sources</phase>
121            <goals>
122              <goal>add-source</goal>
123            </goals>
124            <configuration>
125              <sources>
126                <source>${generated.sources.dir}</source>
127              </sources>
128            </configuration>
129          </execution>
130          <execution>
131            <id>add-generated-test-sources</id>
132            <phase>generate-test-sources</phase>
133            <goals>
134              <goal>add-test-source</goal>
135            </goals>
136            <configuration>
137              <sources>
138                <source>${generated.testsources.dir}</source>
139              </sources>
140            </configuration>
141          </execution>
142        </executions>
143      </plugin>
144
145      <!-- OSGI bundle configuration -->
146      <plugin>
147        <groupId>org.apache.felix</groupId>
148        <artifactId>maven-bundle-plugin</artifactId>
149        <extensions>true</extensions>
150        <configuration>
151          <instructions>
152            <Automatic-Module-Name>com.google.protobuf</Automatic-Module-Name> <!-- Java9+ Jigsaw module name -->
153            <Bundle-DocURL>https://developers.google.com/protocol-buffers/</Bundle-DocURL>
154            <Bundle-SymbolicName>com.google.protobuf</Bundle-SymbolicName>
155            <Export-Package>com.google.protobuf;version=${project.version}</Export-Package>
156            <Import-Package>sun.misc;resolution:=optional,*</Import-Package>
157          </instructions>
158        </configuration>
159      </plugin>
160    </plugins>
161  </build>
162
163</project>
164