Skip to content

Commit b9cdeff

Browse files
authored
Merge pull request #11 from codedx/bugfix/update-dependencies
Bugfix/update dependencies
2 parents 7f17f88 + 991f822 commit b9cdeff

File tree

7 files changed

+64
-61
lines changed

7 files changed

+64
-61
lines changed

IntelliJNotes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ The following are some notes taken by a user who set up the plugin for developme
44

55
* Import pom.xml using IntelliJ
66

7-
* Point IntelliJ to the Maven version installed to the Atlassian plugin SDK: File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Maven home directory. Default installation of the plugin SDK is in C:\Applications\Atlassian
7+
* Point IntelliJ to the Maven version installed to the Atlassian plugin SDK: `File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Maven home directory`. Default installation of the plugin SDK on Windows is in `C:\Applications\Atlassian`. Set this field to the `apache-maven-...` folder in the SDK folder. (If you run `atlas-build` or `atlas-run`, some of the logs will typically reference the install path.)
88

9-
* To run the built plugin in an instance of bamboo, run the bamboo:run maven task.
9+
* To run the built plugin in an instance of bamboo, run the `bamboo:run` maven task.
1010

11-
* The plugin can be configured with QuickReload in the codedx-bamboo-plugin POM file. If this is set to true, a developer only needs to run bamboo:run, and then run atlas-mvn package in a seperate console session to build an updated version of the plugin, and have the Bamboo instance automatically reload the plugin.
11+
* The plugin can be configured with QuickReload in the codedx-bamboo-plugin POM file. If this is set to true, a developer only needs to run `bamboo:run`, and then run atlas-mvn package in a separate console session to build an updated version of the plugin, and have the Bamboo instance automatically reload the plugin.
1212

1313
* When setting up bamboo, don't forget to configure your git install directory via the Server capabilities administration menu.
1414

15-
* To debug in Intellij: run bamboo:debug, then go to Run->Attach to local process... and select the Catalina process.
15+
* To debug in Intellij: run `bamboo:debug`, then go to `Run->Attach to local process...` and select the Catalina process.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ codedx-bamboo-plugin
88
1. Install Atlassian Plugin SDK: (Windows url) - https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/
99
Additional information about the SDK can be found here - https://developer.atlassian.com/display/DOCS/Introduction+to+the+Atlassian+Plugin+SDK
1010

11-
2. For development, IntelliJ is recommended. If stuck setting up IntelliJ, [some notes are included here](IntelliJNotes.md) from a user who set up the plugin for development in IntelliJ on Windows.
11+
2. For development, IntelliJ is recommended. See [the notes included here](IntelliJNotes.md) for detailed instructions on how to configure IntelliJ to load the project and resolve dependencies.
1212

1313
3. If needed, update the Swagger client [following the instructions here](SwaggerSetup.md). This shouldn't be needed but may be necessary if there is a version mismatch with the Code Dx server.
1414

@@ -30,7 +30,7 @@ codedx-bamboo-plugin
3030

3131
### Running and Debugging from Command Line
3232

33-
* The following commands can be used to run and debug the plugin from the root of this repository. Only the run command was tested (briefly), and it didn't work consistently.
33+
* The following commands can be used to run and debug the plugin from the root of this repository. Only the run command was tested (briefly), and it didn't work consistently. (Normal `mvn` commands won't work, must use the `atlas-*` commands.)
3434

3535
`atlas-run`
3636
`atlas-debug`

pom.xml

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<modelVersion>4.0.0</modelVersion>
88
<groupId>com.codedx</groupId>
99
<artifactId>codedx-bamboo-plugin</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
10+
<version>2.0.0</version>
1111

1212
<organization>
1313
<name>Code Dx</name>
@@ -19,20 +19,20 @@
1919
<packaging>atlassian-plugin</packaging>
2020

2121
<properties>
22-
23-
<bamboo.version>6.3.2</bamboo.version>
24-
<bamboo.data.version>6.3.2</bamboo.data.version>
25-
<amps.version>6.3.15</amps.version>
26-
<plugin.testrunner.version>1.2.3</plugin.testrunner.version>
27-
<atlassian.spring.scanner.version>1.2.13</atlassian.spring.scanner.version>
28-
<jersey-version>2.25.1</jersey-version>
29-
<jackson-version>2.9.8</jackson-version>
22+
<!-- note: change to 9.0.0 for local development with `atlas-run` etc., prior versions have a broken UI -->
23+
<bamboo.version>7.1.1</bamboo.version>
24+
<bamboo.data.version>${bamboo.version}</bamboo.data.version>
25+
<amps.version>8.1.2</amps.version>
26+
<plugin.testrunner.version>2.0.2</plugin.testrunner.version>
27+
<atlassian.spring.scanner.version>2.1.7</atlassian.spring.scanner.version>
28+
<jersey-version>2.41</jersey-version>
29+
<jackson-version>2.15.2</jackson-version>
3030
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
3131
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
3232
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3333
<maven.compiler.source>1.8</maven.compiler.source>
3434
<maven.compiler.target>1.8</maven.compiler.target>
35-
<junit-version>4.12</junit-version>
35+
<junit-version>4.13.2</junit-version>
3636
<swagger-core-version>1.5.15</swagger-core-version>
3737

3838
</properties>
@@ -64,13 +64,13 @@
6464
<dependency>
6565
<groupId>org.apache.ant</groupId>
6666
<artifactId>ant</artifactId>
67-
<version>1.8.2</version>
67+
<version>1.10.14</version>
6868
</dependency>
6969

7070
<dependency>
7171
<groupId>com.google.code.gson</groupId>
7272
<artifactId>gson</artifactId>
73-
<version>2.2.2-atlassian-1</version>
73+
<version>2.8.9</version>
7474
</dependency>
7575

7676
<!-- HTTP client: jersey-client -->
@@ -109,10 +109,10 @@
109109
<dependency>
110110
<groupId>com.github.joschi.jackson</groupId>
111111
<artifactId>jackson-datatype-threetenbp</artifactId>
112-
<version>2.6.4</version>
112+
<version>${jackson-version}</version>
113113
</dependency>
114114

115-
<!-- Base64 encoding that works in both JVM and Android -->
115+
<!-- Note: Required by Swagger-generated API client impl. for Basic Auth, but basic auth is not used here -->
116116
<dependency>
117117
<groupId>com.brsanthu</groupId>
118118
<artifactId>migbase64</artifactId>
@@ -125,32 +125,33 @@
125125
<plugins>
126126
<plugin>
127127
<groupId>com.atlassian.maven.plugins</groupId>
128-
<artifactId>maven-bamboo-plugin</artifactId>
128+
<artifactId>bamboo-maven-plugin</artifactId>
129129
<version>${amps.version}</version>
130130
<extensions>true</extensions>
131131
<configuration>
132132
<productVersion>${bamboo.version}</productVersion>
133133
<productDataVersion>${bamboo.data.version}</productDataVersion>
134134
<enableQuickReload>true</enableQuickReload>
135-
<enableFastdev>false</enableFastdev>
135+
</configuration>
136+
</plugin>
137+
138+
<plugin>
139+
<groupId>com.atlassian.plugin</groupId>
140+
<artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
141+
<version>${atlassian.spring.scanner.version}</version>
142+
<executions>
143+
<execution>
144+
<goals>
145+
<goal>atlassian-spring-scanner</goal>
146+
</goals>
147+
<phase>process-classes</phase>
148+
</execution>
149+
</executions>
150+
<configuration>
151+
<verbose>false</verbose>
136152
</configuration>
137153
</plugin>
138154
</plugins>
139155
</build>
140156

141-
<pluginRepositories>
142-
<pluginRepository>
143-
<releases>
144-
<enabled>true</enabled>
145-
<checksumPolicy>warn</checksumPolicy>
146-
</releases>
147-
<snapshots>
148-
<updatePolicy>never</updatePolicy>
149-
<checksumPolicy>warn</checksumPolicy>
150-
</snapshots>
151-
<id>atlassian-public</id>
152-
<url>https://maven.atlassian.com/repository/public</url>
153-
</pluginRepository>
154-
</pluginRepositories>
155-
156157
</project>

src/main/java/com/codedx/client/CustomInstantDeserializer.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
package com.codedx.client;
22

3+
import com.fasterxml.jackson.annotation.JsonFormat;
34
import com.fasterxml.jackson.core.JsonParser;
45
import com.fasterxml.jackson.core.JsonTokenId;
56
import com.fasterxml.jackson.databind.DeserializationContext;
67
import com.fasterxml.jackson.databind.DeserializationFeature;
78
import com.fasterxml.jackson.databind.JsonDeserializer;
8-
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
99
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
1010
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
1111
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
1212
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
13-
import org.threeten.bp.DateTimeException;
14-
import org.threeten.bp.Instant;
15-
import org.threeten.bp.OffsetDateTime;
16-
import org.threeten.bp.ZoneId;
17-
import org.threeten.bp.ZonedDateTime;
13+
import org.threeten.bp.*;
1814
import org.threeten.bp.format.DateTimeFormatter;
1915
import org.threeten.bp.temporal.Temporal;
2016
import org.threeten.bp.temporal.TemporalAccessor;
@@ -147,13 +143,25 @@ protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeF
147143
}
148144

149145
@Override
150-
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
146+
protected ThreeTenDateTimeDeserializerBase<T> withDateFormat(DateTimeFormatter dtf) {
151147
if (dtf == _formatter) {
152148
return this;
153149
}
154150
return new CustomInstantDeserializer<T>(this, dtf);
155151
}
156152

153+
@Override
154+
protected ThreeTenDateTimeDeserializerBase<T> withLeniency(Boolean leniency) {
155+
// not relevant for us
156+
return this;
157+
}
158+
159+
@Override
160+
protected ThreeTenDateTimeDeserializerBase<T> withShape(JsonFormat.Shape shape) {
161+
// not relevant for us
162+
return this;
163+
}
164+
157165
@Override
158166
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
159167
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
@@ -205,7 +213,7 @@ public T deserialize(JsonParser parser, DeserializationContext context) throws I
205213

206214
private ZoneId getZone(DeserializationContext context) {
207215
// Instants are always in UTC, so don't waste compute cycles
208-
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
216+
return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone());
209217
}
210218

211219
private static class FromIntegerArguments {

src/main/java/com/codedx/plugins/bamboo/CodeDxScanTask.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22

33
import com.atlassian.bamboo.build.logger.BuildLogger;
44
import com.atlassian.bamboo.configuration.ConfigurationMap;
5-
import com.atlassian.bamboo.task.TaskContext;
6-
import com.atlassian.bamboo.task.TaskException;
7-
import com.atlassian.bamboo.task.TaskResult;
8-
import com.atlassian.bamboo.task.TaskResultBuilder;
9-
import com.atlassian.bamboo.task.TaskType;
10-
import com.atlassian.util.concurrent.NotNull;
11-
import com.codedx.plugins.bamboo.utils.Archiver;
12-
import com.codedx.plugins.bamboo.utils.CodeDxBuildStatistics;
5+
import com.atlassian.bamboo.task.*;
136
import com.codedx.client.ApiClient;
147
import com.codedx.client.ApiException;
158
import com.codedx.client.api.*;
9+
import com.codedx.plugins.bamboo.utils.Archiver;
10+
import com.codedx.plugins.bamboo.utils.CodeDxBuildStatistics;
1611
import org.apache.log4j.Logger;
1712

1813
import java.io.File;
@@ -62,8 +57,7 @@ private static class ScanTaskState {
6257
List<GroupedCount> groupedCounts;
6358
}
6459

65-
@NotNull
66-
@java.lang.Override
60+
@Override
6761
public TaskResult execute(final TaskContext taskContext) throws TaskException
6862
{
6963
ScanTaskState state = new ScanTaskState();

src/main/java/com/codedx/plugins/bamboo/ServerConfigManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.atlassian.bamboo.bandana.PlanAwareBandanaContext;
44
import com.atlassian.bandana.BandanaContext;
55
import com.atlassian.bandana.BandanaManager;
6-
import com.codedx.plugins.bamboo.security.SSLContextFactory;
76
import com.codedx.client.ApiClient;
7+
import com.codedx.plugins.bamboo.security.SSLContextFactory;
88
import org.apache.log4j.Logger;
99
import org.glassfish.jersey.client.JerseyClientBuilder;
1010

@@ -24,8 +24,8 @@ public class ServerConfigManager implements Serializable {
2424
private static final String BANDANA_KEY = "com.codedx.bambooplugin:Config";
2525

2626
// This gets called automatically
27-
public void setBandanaManager(BandanaManager bandanaManager) {
28-
this.bandanaManager = bandanaManager;
27+
public ServerConfigManager(BandanaManager bandanaManager) {
28+
ServerConfigManager.bandanaManager = bandanaManager;
2929
}
3030

3131
public static String getUrl() {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner"
4+
xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
55
xsi:schemaLocation="http://www.springframework.org/schema/beans
6-
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
6+
http://www.springframework.org/schema/beans/spring-beans.xsd
77
http://www.atlassian.com/schema/atlassian-scanner
88
http://www.atlassian.com/schema/atlassian-scanner/atlassian-scanner.xsd">
99
<atlassian-scanner:scan-indexes/>
10-
</beans>
10+
</beans>

0 commit comments

Comments
 (0)