bisq/common/pom.xml
Chris Beams 19b9c6fe59
Set Maven version to -SNAPSHOT
Problem: d218094 set the version to 0.7.0-SNAPSHOT, but that change
failed to produce the intended effect detailed in the commit comment.
Setting the version to a value like 0.7.0-SNAPSHOT works fine when
publishing artifacts to a local ~/.m2 repository, but JitPack has no
awareness of version metadata within pom files, and can only retreive
artifacts based on Git metadata, namely tags, branch names and commit
hashes. This means it is impossible to resolve artifacts from JitPack
with a GAV like `io.bisq.exchange:core:0.7.0-SNAPSHOT` unless there is a
branch named `0.7.0`. This is why the pull request at
bisq-network/bisq-seednode#1 failed.

Solution: JitPack supports the semantics of Maven-style `-SNAPSHOT`
versioning, and as a special case, allows for versions to be named
literally `-SNAPSHOT` with no preceding version string [1,2]. This
commit sets all Maven versions to `-SNAPSHOT`, achieving the original
effect intended by d218094. Now downstream components (like
bisq-seednode) can resolve dependencies seamlessly from JitPack or a
local ~/.m2 repo with a GAV like `io.bisq.exchange:core:-SNAPSHOT`. This
is a slightly unconventional arrangement, but should actually result in
fewer updates to pom files over time as there may in fact be no reason
to ever change this version string so long as we continue using JitPack
and avoid publication to Maven Central / JCenter or similar.

[1]: https://jitpack.io/docs/#building-with-jitpack
[2]: https://github.com/jitpack/jitpack.io/issues/351

See #1440
2018-03-09 10:29:23 +01:00

179 lines
6.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>io.bisq.exchange</groupId>
<version>-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common</artifactId>
<properties>
<protobuf.version>3.3.0</protobuf.version>
</properties>
<profiles>
<profile>
<id>windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<protobuf.classifier>windows-x86_64</protobuf.classifier>
<protobuf.exe>protoc.exe</protobuf.exe>
</properties>
</profile>
<profile>
<id>unix</id>
<activation>
<os>
<family>unix</family>
<name>Linux</name>
</os>
</activation>
<properties>
<protobuf.classifier>linux-x86_64</protobuf.classifier>
<protobuf.exe>protoc</protobuf.exe>
</properties>
</profile>
<profile>
<id>macos</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<protobuf.classifier>osx-x86_64</protobuf.classifier>
<protobuf.exe>protoc</protobuf.exe>
</properties>
</profile>
</profiles>
<build>
<plugins>
<!-- unpack correct protobuf exe for current os -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-protoc</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.google.protobuf</groupId>
<artifactId>protoc</artifactId>
<version>${protobuf.version}</version>
<classifier>${protobuf.classifier}</classifier>
<type>exe</type>
<overWrite>true</overWrite>
<destFileName>${protobuf.exe}</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>set-permissions</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<chmod file="${project.build.directory}/dependency/${protobuf.exe}" perm="u+rx"/>
<echo message="permissions changed for ${project.build.directory}/dependency/${protobuf.exe}"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
<!-- Run protobuf https://www.xolstice.org/protobuf-maven-plugin/usage.html -->
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocExecutable>${project.build.directory}/dependency/${protobuf.exe}</protocExecutable>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.bisq.exchange</groupId>
<artifactId>consensus</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
</dependency>
<!-- Only used for the JsonFormat class, can otherwise be put in scope 'test' -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>${protobuf.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
<!-- used only for reading json file for trade statistic migration
can be removed later -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
</project>