Skip to content

Commit df26dba

Browse files
authored
Merge pull request #195 from bmarwell/194-deps
[#194] dependency cleanup
2 parents ab0ed5a + 9e7f4a8 commit df26dba

File tree

7 files changed

+97
-66
lines changed

7 files changed

+97
-66
lines changed

pom.xml

+85-48
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<maven.compiler.target>${java.version}</maven.compiler.target>
1919

2020
<maven.version>3.3.9</maven.version>
21-
<maven.annotations.version>3.5</maven.annotations.version>
21+
<maven.annotations.version>3.3</maven.annotations.version>
2222
<maven.plugin.plugin.version>3.3</maven.plugin.plugin.version>
2323
<!-- actually a dependency here. -->
2424
<dependency.maven.bundle.plugin.version>4.2.1</dependency.maven.bundle.plugin.version>
@@ -84,6 +84,53 @@
8484
<artifactId>biz.aQute.bndlib</artifactId>
8585
<version>5.2.0</version>
8686
</dependency>
87+
88+
<!-- 3.0 used by tycho. Force the target maven version here. -->
89+
<dependency>
90+
<groupId>org.apache.maven</groupId>
91+
<artifactId>maven-compat</artifactId>
92+
<version>${maven.version}</version>
93+
</dependency>
94+
<!-- 3.0 used by tycho. Force the target maven version here. -->
95+
<dependency>
96+
<groupId>org.apache.maven</groupId>
97+
<artifactId>maven-core</artifactId>
98+
<version>${maven.version}</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
<!-- 3.0 used by tycho. Force the target maven version here. -->
102+
<dependency>
103+
<groupId>org.apache.maven</groupId>
104+
<artifactId>maven-settings</artifactId>
105+
<version>${maven.version}</version>
106+
<scope>provided</scope>
107+
</dependency>
108+
<!-- 3.0 used by org.twdata.maven:mojo-executor. -->
109+
<dependency>
110+
<groupId>org.apache.maven</groupId>
111+
<artifactId>maven-model</artifactId>
112+
<version>${maven.version}</version>
113+
</dependency>
114+
<!-- 3.0 used by tycho -->
115+
<dependency>
116+
<groupId>org.apache.maven</groupId>
117+
<artifactId>maven-plugin-api</artifactId>
118+
<version>${maven.version}</version>
119+
</dependency>
120+
<!-- 3.0 used by maven-plugin-annotations -->
121+
<dependency>
122+
<groupId>org.apache.maven</groupId>
123+
<artifactId>maven-artifact</artifactId>
124+
<version>${maven.version}</version>
125+
</dependency>
126+
127+
<!-- 1.5.5 used by tycho, others use 1.6 -->
128+
<dependency>
129+
<groupId>org.codehaus.plexus</groupId>
130+
<artifactId>plexus-component-annotations</artifactId>
131+
<version>1.6</version>
132+
<scope>provided</scope>
133+
</dependency>
87134
</dependencies>
88135
</dependencyManagement>
89136

@@ -92,26 +139,12 @@
92139
<groupId>org.apache.maven</groupId>
93140
<artifactId>maven-core</artifactId>
94141
<version>${maven.version}</version>
95-
<scope>provided</scope>
96-
<exclusions>
97-
<exclusion>
98-
<groupId>junit</groupId>
99-
<artifactId>junit</artifactId>
100-
</exclusion>
101-
</exclusions>
102-
</dependency>
103-
<dependency>
104-
<groupId>org.apache.maven</groupId>
105-
<artifactId>maven-model</artifactId>
106-
<version>${maven.version}</version>
107-
<scope>provided</scope>
108142
</dependency>
109143
<dependency>
110144
<groupId>org.apache.maven</groupId>
111145
<artifactId>maven-plugin-api</artifactId>
112-
<version>${maven.version}</version>
113-
<scope>provided</scope>
114146
</dependency>
147+
115148
<!-- dependencies to annotations -->
116149
<dependency>
117150
<groupId>org.apache.maven.plugin-tools</groupId>
@@ -121,6 +154,10 @@
121154
<!-- annotations are needed only to build the plugin -->
122155
</dependency>
123156

157+
<dependency>
158+
<groupId>org.codehaus.plexus</groupId>
159+
<artifactId>plexus-component-annotations</artifactId>
160+
</dependency>
124161

125162
<!-- org.sonatype.aether artifacts ARE provided by Maven 3.0.x -->
126163
<dependency>
@@ -148,25 +185,9 @@
148185
<version>${eclipse.aether.version}</version>
149186
</dependency>
150187

151-
<dependency>
152-
<groupId>org.apache.maven</groupId>
153-
<artifactId>maven-compat</artifactId>
154-
<version>${maven.version}</version>
155-
<scope>provided</scope>
156-
</dependency>
157188
<dependency>
158189
<groupId>commons-io</groupId>
159190
<artifactId>commons-io</artifactId>
160-
<version>2.5</version>
161-
</dependency>
162-
<dependency>
163-
<groupId>commons-collections</groupId>
164-
<artifactId>commons-collections</artifactId>
165-
<version>3.2.2</version>
166-
</dependency>
167-
<dependency>
168-
<groupId>commons-lang</groupId>
169-
<artifactId>commons-lang</artifactId>
170191
<version>2.6</version>
171192
</dependency>
172193
<dependency>
@@ -178,11 +199,6 @@
178199
<groupId>biz.aQute.bnd</groupId>
179200
<artifactId>biz.aQute.bndlib</artifactId>
180201
</dependency>
181-
<dependency>
182-
<groupId>org.apache.commons</groupId>
183-
<artifactId>commons-exec</artifactId>
184-
<version>1.3</version>
185-
</dependency>
186202
<dependency>
187203
<groupId>org.twdata.maven</groupId>
188204
<artifactId>mojo-executor</artifactId>
@@ -199,17 +215,18 @@
199215
</exclusion>
200216
</exclusions>
201217
</dependency>
218+
202219
<dependency>
203-
<groupId>org.eclipse.tycho.extras</groupId>
204-
<artifactId>tycho-p2-extras-plugin</artifactId>
220+
<groupId>org.eclipse.tycho</groupId>
221+
<artifactId>tycho-core</artifactId>
205222
<version>${tycho.version}</version>
206223
</dependency>
207224
<dependency>
208-
<groupId>org.eclipse.tycho</groupId>
209-
<artifactId>tycho-packaging-plugin</artifactId>
210-
<version>${tycho.version}</version>
211-
<type>maven-plugin</type>
225+
<groupId>org.eclipse.tycho</groupId>
226+
<artifactId>sisu-equinox-launching</artifactId>
227+
<version>${tycho.version}</version>
212228
</dependency>
229+
213230
<dependency>
214231
<groupId>junit</groupId>
215232
<artifactId>junit</artifactId>
@@ -227,11 +244,6 @@
227244
<artifactId>groovy</artifactId>
228245
<version>${groovy.version}</version>
229246
</dependency>
230-
<dependency>
231-
<groupId>com.cenqua.clover</groupId>
232-
<artifactId>clover</artifactId>
233-
<version>${clover.version}</version>
234-
</dependency>
235247
</dependencies>
236248

237249
<build>
@@ -683,6 +695,31 @@
683695
</plugins>
684696
</build>
685697
</profile>
698+
<profile>
699+
<id>convergence</id>
700+
<build>
701+
<plugins>
702+
<plugin>
703+
<groupId>org.apache.maven.plugins</groupId>
704+
<artifactId>maven-enforcer-plugin</artifactId>
705+
<version>3.0.0-M3</version>
706+
<executions>
707+
<execution>
708+
<id>enforce</id>
709+
<configuration>
710+
<rules>
711+
<dependencyConvergence/>
712+
</rules>
713+
</configuration>
714+
<goals>
715+
<goal>enforce</goal>
716+
</goals>
717+
</execution>
718+
</executions>
719+
</plugin>
720+
</plugins>
721+
</build>
722+
</profile>
686723
</profiles>
687724

688725
<distributionManagement>

src/main/groovy/org/reficio/p2/resolver/maven/impl/AetherResolver.groovy

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
package org.reficio.p2.resolver.maven.impl
2020

21-
import org.apache.commons.lang.StringUtils
2221
import org.reficio.p2.logger.Logger
2322
import org.reficio.p2.resolver.maven.impl.facade.AetherFacade
2423
import org.reficio.p2.resolver.maven.Artifact
@@ -128,7 +127,7 @@ class AetherResolver implements ArtifactResolver {
128127
private static List<String> transformExcludes(String artifact, List<String> excludes) {
129128
List<String> transformedExcludes = []
130129
for (String exclude : excludes) {
131-
if (StringUtils.isBlank(exclude)) {
130+
if (exclude == null || exclude.trim().isEmpty()) {
132131
// aether bug fix
133132
Logger.getLog().warn("Empty exclude counts as exclude-all wildcard '*' [${artifact}]")
134133
transformedExcludes += "*"

src/main/java/org/reficio/p2/FeatureBuilder.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import javax.xml.parsers.DocumentBuilderFactory;
2727
import javax.xml.parsers.ParserConfigurationException;
2828

29-
import org.apache.commons.lang.StringUtils;
3029
import org.reficio.p2.bundler.ArtifactBundlerInstructions;
3130
import org.reficio.p2.logger.Logger;
3231
import org.reficio.p2.utils.JarUtils;
@@ -178,7 +177,7 @@ private void generateFeatureContent(Document xmlDoc, Element featureElement) {
178177
if (generateSourceFeature) {
179178
// 2015-05-12/RPr: A Source feature contains only sources.
180179
id = abi.getSourceSymbolicName();
181-
if (StringUtils.isBlank(id)) {
180+
if (id == null || id.trim().isEmpty()) {
182181
log().info("\t [WARN] No source found for " + abi.getSymbolicName());
183182
continue;
184183
}

src/main/java/org/reficio/p2/P2Helper.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@
2121
import aQute.bnd.osgi.Analyzer;
2222
import aQute.bnd.osgi.Jar;
2323
import org.apache.commons.io.FileUtils;
24-
import org.apache.commons.lang.StringUtils;
2524
import org.reficio.p2.bundler.ArtifactBundlerInstructions;
2625
import org.reficio.p2.bundler.ArtifactBundlerRequest;
2726
import org.reficio.p2.bundler.impl.AquteHelper;
2827
import org.reficio.p2.resolver.maven.Artifact;
2928
import org.reficio.p2.resolver.maven.ResolvedArtifact;
3029
import org.reficio.p2.utils.BundleUtils;
31-
import org.reficio.p2.utils.JarUtils;
3230
import org.reficio.p2.utils.Utils;
3331

3432
import java.io.File;
@@ -151,7 +149,7 @@ private static String calculateFullSymbolicName(P2Artifact p2Artifact, ResolvedA
151149
}
152150
// bug28 - handle classifiers
153151
String classifier = resolvedArtifact.getArtifact().getClassifier();
154-
if (StringUtils.isNotBlank(classifier)) {
152+
if (classifier != null && !classifier.trim().equals("")) {
155153
symbolicName += "." + classifier;
156154
}
157155
return symbolicName;

src/main/java/org/reficio/p2/P2Mojo.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.google.common.collect.Sets;
2525
import org.apache.commons.io.FileUtils;
2626
import org.apache.commons.io.IOUtils;
27-
import org.apache.commons.lang.StringUtils;
2827
import org.apache.maven.execution.MavenSession;
2928
import org.apache.maven.plugin.AbstractMojo;
3029
import org.apache.maven.plugin.AbstractMojoExecutionException;
@@ -542,7 +541,7 @@ private void executeCategoryPublisher() throws AbstractMojoExecutionException, I
542541
}
543542

544543
private void prepareCategoryLocationFile() throws IOException {
545-
if (StringUtils.isBlank(categoryFileURL)) {
544+
if (categoryFileURL == null || categoryFileURL.trim().isEmpty()) {
546545
InputStream is = getClass().getResourceAsStream(DEFAULT_CATEGORY_CLASSPATH_LOCATION + DEFAULT_CATEGORY_FILE);
547546
File destinationFolder = new File(destinationDirectory);
548547
destinationFolder.mkdirs();

src/main/java/org/reficio/p2/resolver/maven/Artifact.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
package org.reficio.p2.resolver.maven;
2020

2121
import java.io.File;
22-
import org.apache.commons.lang.builder.EqualsBuilder;
23-
import org.apache.commons.lang.builder.HashCodeBuilder;
22+
import java.util.Objects;
2423

2524
import static java.util.Arrays.asList;
2625

@@ -116,11 +115,14 @@ public String toString() {
116115

117116
@Override
118117
public boolean equals(Object other) {
119-
return EqualsBuilder.reflectionEquals(this, other, asList("file"));
118+
if (this == other) return true;
119+
if (other == null || getClass() != other.getClass()) return false;
120+
Artifact artifact = (Artifact) other;
121+
return snapshot == artifact.snapshot && Objects.equals(groupId, artifact.groupId) && Objects.equals(artifactId, artifact.artifactId) && Objects.equals(baseVersion, artifact.baseVersion) && Objects.equals(extension, artifact.extension) && Objects.equals(classifier, artifact.classifier) && Objects.equals(version, artifact.version) && Objects.equals(file, artifact.file);
120122
}
121123

122124
@Override
123125
public int hashCode() {
124-
return HashCodeBuilder.reflectionHashCode(this, asList("file"));
126+
return Objects.hash(groupId, artifactId, baseVersion, extension, classifier, snapshot, version, file);
125127
}
126128
}

src/test/integration/integration.xml

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@
5454
<groupId>org.reficio</groupId>
5555
<artifactId>p2-maven-plugin</artifactId>
5656
<version>@project.version@</version>
57-
<configuration>
58-
<providerSelection>1.5</providerSelection>
59-
</configuration>
6057
</plugin>
6158
</plugins>
6259
</pluginManagement>
@@ -67,9 +64,9 @@
6764
<plugin>
6865
<groupId>org.apache.maven.plugins</groupId>
6966
<artifactId>maven-javadoc-plugin</artifactId>
70-
<version>2.5</version>
67+
<version>3.2.0</version>
7168
<configuration>
72-
<source>1.4</source>
69+
<source>1.7</source>
7370
</configuration>
7471
</plugin>
7572
</plugins>

0 commit comments

Comments
 (0)