Skip to content

Commit

Permalink
[FIXED JENKINS-41911] Shade away Jackson
Browse files Browse the repository at this point in the history
This took some hoop-jumping, but now we should be guaranteed to use
our own copy of Jackson at all times. Phew.
  • Loading branch information
abayer committed Feb 10, 2017
1 parent 46fe307 commit 7a06eb4
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 26 deletions.
21 changes: 13 additions & 8 deletions pipeline-model-api/pom.xml
Expand Up @@ -40,14 +40,19 @@
<dependencies>
<!-- JSON schema stuff -->
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>2.2.3</version>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>pipeline-model-json-shaded</artifactId>
<version>1.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
19 changes: 7 additions & 12 deletions pipeline-model-definition/pom.xml
Expand Up @@ -127,18 +127,6 @@
<version>1.3</version>
</dependency>

<!-- JSON schema stuff -->
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>2.2.3</version>
</dependency>

<!-- TEST deps -->
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -180,6 +168,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
<version>2.7.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git</artifactId>
Expand Down
Expand Up @@ -24,9 +24,9 @@
package org.jenkinsci.plugins.pipeline.modeldefinition.parser

import com.cloudbees.groovy.cps.NonCPS
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule
import shaded.com.fasterxml.jackson.databind.JsonNode
import shaded.com.fasterxml.jackson.databind.ObjectMapper
import shaded.com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule
import com.github.fge.jsonschema.exceptions.ProcessingException
import com.github.fge.jsonschema.main.JsonSchema
import com.github.fge.jsonschema.report.ProcessingReport
Expand Down
Expand Up @@ -23,7 +23,7 @@
*/
package org.jenkinsci.plugins.pipeline.modeldefinition.parser

import com.fasterxml.jackson.databind.JsonNode
import shaded.com.fasterxml.jackson.databind.JsonNode
import com.github.fge.jsonschema.exceptions.JsonReferenceException
import com.github.fge.jsonschema.exceptions.ProcessingException
import com.github.fge.jsonschema.jsonpointer.JsonPointer
Expand Down
Expand Up @@ -23,7 +23,7 @@
*/
package org.jenkinsci.plugins.pipeline.modeldefinition.endpoints;

import com.fasterxml.jackson.databind.JsonNode;
import shaded.com.fasterxml.jackson.databind.JsonNode;
import com.github.fge.jsonschema.tree.SimpleJsonTree;
import com.github.fge.jsonschema.util.JsonLoader;
import com.google.common.collect.ImmutableList;
Expand Down
Expand Up @@ -23,7 +23,7 @@
*/
package org.jenkinsci.plugins.pipeline.modeldefinition;

import com.fasterxml.jackson.databind.JsonNode;
import shaded.com.fasterxml.jackson.databind.JsonNode;
import com.github.fge.jsonschema.tree.SimpleJsonTree;
import com.github.fge.jsonschema.util.JsonLoader;
import org.codehaus.groovy.control.ErrorCollector;
Expand Down
82 changes: 82 additions & 0 deletions pipeline-model-json-shaded/pom.xml
@@ -0,0 +1,82 @@
<!--
~ The MIT License
~
~ Copyright (c) 2017, CloudBees, Inc.
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in
~ all copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~ THE SOFTWARE.
-->

<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkinsci.plugins</groupId>
<artifactId>pipeline-model-parent</artifactId>
<version>1.1-SNAPSHOT</version>
</parent>

<artifactId>pipeline-model-json-shaded</artifactId>
<packaging>jar</packaging>
<name>Pipeline: Model Shaded JSON Libraries</name>
<description>Library plugin for Pipeline stage tag metadata</description>
<url>https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Model+Definition+Plugin</url>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<includes>
<include>com.github.fge:*</include>
<include>com.fasterxml*:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.fasterxml</pattern>
<shadedPattern>shaded.com.fasterxml</shadedPattern>
</relocation>
</relocations>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.github.fge</groupId>
<artifactId>json-schema-validator</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
<version>2.2.3</version>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -67,6 +67,7 @@
<module>pipeline-model-api</module>
<module>pipeline-model-declarative-agent</module>
<module>pipeline-model-definition</module>
<module>pipeline-model-json-shaded</module>
</modules>

<build>
Expand Down

0 comments on commit 7a06eb4

Please sign in to comment.