Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Issue #3: improve build
Browse files Browse the repository at this point in the history
  • Loading branch information
magnet committed Nov 20, 2017
1 parent 2301347 commit cf8de7e
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 150 deletions.
2 changes: 1 addition & 1 deletion guava18/osgi.bnd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Bundle-SymbolicName: io.primeval.jackson.guava18
Private-Package: com.fasterxml.jackson.datatype.guava;com.fasterxml.jackson.datatype.guava.*
Private-Package: com.fasterxml.jackson.datatype.guava,com.fasterxml.jackson.datatype.guava.*
Import-Package: com.google.common.*;version='[18,19)',*
76 changes: 2 additions & 74 deletions guava18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,85 +20,13 @@
</properties>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>6.0.0</version>
</dependency>


<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>${jackson.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
<scope>provided</scope>
</dependency>

<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<!-- Override Guava version -->
<version>${guava.version}</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.2.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


</project>

2 changes: 1 addition & 1 deletion guava21/osgi.bnd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Bundle-SymbolicName: io.primeval.jackson.guava21
Private-Package: com.fasterxml.jackson.datatype.guava;com.fasterxml.jackson.datatype.guava.*
Private-Package: com.fasterxml.jackson.datatype.guava,com.fasterxml.jackson.datatype.guava.*
Import-Package: com.google.common.*;version='[21,22)',*
76 changes: 2 additions & 74 deletions guava21/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,85 +20,13 @@
</properties>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>6.0.0</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>${jackson.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<!-- Override Guava version -->
<version>${guava.version}</version><!--$NO-MVN-MAN-VER$ -->
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
<scope>provided</scope>
</dependency>

<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.2.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


</project>

3 changes: 3 additions & 0 deletions guava23/osgi.bnd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bundle-SymbolicName: io.primeval.jackson.guava23
Private-Package: com.fasterxml.jackson.datatype.guava,com.fasterxml.jackson.datatype.guava.*
Import-Package: com.google.common.*;version='[23,24)',*
32 changes: 32 additions & 0 deletions guava23/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.primeval</groupId>
<artifactId>primeval-jackson-guava</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>


<artifactId>primeval-jackson-guava23</artifactId>
<packaging>jar</packaging>

<name>Primeval Jackson Guava 23 Provider</name>
<description>Primeval JSON Jackson Guava 23 Provider</description>

<properties>
<guava.version>23.4-jre</guava.version>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- Override Guava version -->
<version>${guava.version}</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
</dependencies>

</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.primeval.json.jackson.guava23;

import org.osgi.service.component.annotations.Component;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.datatype.guava.GuavaModule;

@Component(service = Module.class)
public final class GuavaModulePublisher extends GuavaModule {
// Nothing, just publish GuavaModule
}
137 changes: 137 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,148 @@

<properties>
<jackson.version>2.9.1</jackson.version>
<primeval-3rdparty-bom.version>1.0.0-SNAPSHOT</primeval-3rdparty-bom.version>
</properties>

<modules>
<module>guava18</module>
<module>guava21</module>
<module>guava23</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.primeval</groupId>
<artifactId>primeval-thirdparty-bom</artifactId>
<version>${primeval-3rdparty-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>


<profiles>
<profile>
<id>jackson-guava</id>
<activation>
<file>
<exists>src/main/java</exists>
</file>
</activation>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>


<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>${jackson.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>jackson-guava-deploy</id>
<activation>
<file>
<exists>src/main/java</exists>
</file>
<property>
<name>deploy</name>
</property>
</activation>
<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>dependency-sources</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<includeGroupIds>com.fasterxml.jackson.datatype</includeGroupIds>
<includeArtifactIds>jackson-datatype-guava</includeArtifactIds>
<stripVersion>true</stripVersion>
<stripClassifier>true</stripClassifier>
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
<outputDirectory>${project.build.directory}/sources</outputDirectory>
<silent>true</silent>
</configuration>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<id>source-jar</id>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${basedir}/../src/assembly/source-jar.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
<attach>true</attach>
<archiverConfig></archiverConfig>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<skipSource>true</skipSource>
</configuration>
</plugin>



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- switch on dependency-driven aggregation -->
<includeDependencySources>true</includeDependencySources>
<additionalparam>-Xdoclint:none</additionalparam>

<quiet>true</quiet>
<failOnError>false</failOnError>
<dependencySourceIncludes>
<dependencySourceInclude>com.fasterxml.jackson.datatype:jackson-datatype-guava</dependencySourceInclude>
</dependencySourceIncludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

Loading

0 comments on commit cf8de7e

Please sign in to comment.