Skip to content

Commit

Permalink
Merge pull request #195 from bmarwell/194-deps
Browse files Browse the repository at this point in the history
[#194] dependency cleanup
  • Loading branch information
sparsick authored Feb 19, 2021
2 parents ab0ed5a + 9e7f4a8 commit df26dba
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 66 deletions.
133 changes: 85 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<maven.compiler.target>${java.version}</maven.compiler.target>

<maven.version>3.3.9</maven.version>
<maven.annotations.version>3.5</maven.annotations.version>
<maven.annotations.version>3.3</maven.annotations.version>
<maven.plugin.plugin.version>3.3</maven.plugin.plugin.version>
<!-- actually a dependency here. -->
<dependency.maven.bundle.plugin.version>4.2.1</dependency.maven.bundle.plugin.version>
Expand Down Expand Up @@ -84,6 +84,53 @@
<artifactId>biz.aQute.bndlib</artifactId>
<version>5.2.0</version>
</dependency>

<!-- 3.0 used by tycho. Force the target maven version here. -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${maven.version}</version>
</dependency>
<!-- 3.0 used by tycho. Force the target maven version here. -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<!-- 3.0 used by tycho. Force the target maven version here. -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<!-- 3.0 used by org.twdata.maven:mojo-executor. -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
</dependency>
<!-- 3.0 used by tycho -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<!-- 3.0 used by maven-plugin-annotations -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
</dependency>

<!-- 1.5.5 used by tycho, others use 1.6 -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -92,26 +139,12 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>

<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
Expand All @@ -121,6 +154,10 @@
<!-- annotations are needed only to build the plugin -->
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</dependency>

<!-- org.sonatype.aether artifacts ARE provided by Maven 3.0.x -->
<dependency>
Expand Down Expand Up @@ -148,25 +185,9 @@
<version>${eclipse.aether.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
Expand All @@ -178,11 +199,6 @@
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bndlib</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
Expand All @@ -199,17 +215,18 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-core</artifactId>
<version>${tycho.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<type>maven-plugin</type>
<groupId>org.eclipse.tycho</groupId>
<artifactId>sisu-equinox-launching</artifactId>
<version>${tycho.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -227,11 +244,6 @@
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
<dependency>
<groupId>com.cenqua.clover</groupId>
<artifactId>clover</artifactId>
<version>${clover.version}</version>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -683,6 +695,31 @@
</plugins>
</build>
</profile>
<profile>
<id>convergence</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce</id>
<configuration>
<rules>
<dependencyConvergence/>
</rules>
</configuration>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.reficio.p2.resolver.maven.impl

import org.apache.commons.lang.StringUtils
import org.reficio.p2.logger.Logger
import org.reficio.p2.resolver.maven.impl.facade.AetherFacade
import org.reficio.p2.resolver.maven.Artifact
Expand Down Expand Up @@ -128,7 +127,7 @@ class AetherResolver implements ArtifactResolver {
private static List<String> transformExcludes(String artifact, List<String> excludes) {
List<String> transformedExcludes = []
for (String exclude : excludes) {
if (StringUtils.isBlank(exclude)) {
if (exclude == null || exclude.trim().isEmpty()) {
// aether bug fix
Logger.getLog().warn("Empty exclude counts as exclude-all wildcard '*' [${artifact}]")
transformedExcludes += "*"
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/reficio/p2/FeatureBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.commons.lang.StringUtils;
import org.reficio.p2.bundler.ArtifactBundlerInstructions;
import org.reficio.p2.logger.Logger;
import org.reficio.p2.utils.JarUtils;
Expand Down Expand Up @@ -178,7 +177,7 @@ private void generateFeatureContent(Document xmlDoc, Element featureElement) {
if (generateSourceFeature) {
// 2015-05-12/RPr: A Source feature contains only sources.
id = abi.getSourceSymbolicName();
if (StringUtils.isBlank(id)) {
if (id == null || id.trim().isEmpty()) {
log().info("\t [WARN] No source found for " + abi.getSymbolicName());
continue;
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/reficio/p2/P2Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
import aQute.bnd.osgi.Analyzer;
import aQute.bnd.osgi.Jar;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.reficio.p2.bundler.ArtifactBundlerInstructions;
import org.reficio.p2.bundler.ArtifactBundlerRequest;
import org.reficio.p2.bundler.impl.AquteHelper;
import org.reficio.p2.resolver.maven.Artifact;
import org.reficio.p2.resolver.maven.ResolvedArtifact;
import org.reficio.p2.utils.BundleUtils;
import org.reficio.p2.utils.JarUtils;
import org.reficio.p2.utils.Utils;

import java.io.File;
Expand Down Expand Up @@ -151,7 +149,7 @@ private static String calculateFullSymbolicName(P2Artifact p2Artifact, ResolvedA
}
// bug28 - handle classifiers
String classifier = resolvedArtifact.getArtifact().getClassifier();
if (StringUtils.isNotBlank(classifier)) {
if (classifier != null && !classifier.trim().equals("")) {
symbolicName += "." + classifier;
}
return symbolicName;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/reficio/p2/P2Mojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.common.collect.Sets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.AbstractMojoExecutionException;
Expand Down Expand Up @@ -542,7 +541,7 @@ private void executeCategoryPublisher() throws AbstractMojoExecutionException, I
}

private void prepareCategoryLocationFile() throws IOException {
if (StringUtils.isBlank(categoryFileURL)) {
if (categoryFileURL == null || categoryFileURL.trim().isEmpty()) {
InputStream is = getClass().getResourceAsStream(DEFAULT_CATEGORY_CLASSPATH_LOCATION + DEFAULT_CATEGORY_FILE);
File destinationFolder = new File(destinationDirectory);
destinationFolder.mkdirs();
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/org/reficio/p2/resolver/maven/Artifact.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
package org.reficio.p2.resolver.maven;

import java.io.File;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import java.util.Objects;

import static java.util.Arrays.asList;

Expand Down Expand Up @@ -116,11 +115,14 @@ public String toString() {

@Override
public boolean equals(Object other) {
return EqualsBuilder.reflectionEquals(this, other, asList("file"));
if (this == other) return true;
if (other == null || getClass() != other.getClass()) return false;
Artifact artifact = (Artifact) other;
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);
}

@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this, asList("file"));
return Objects.hash(groupId, artifactId, baseVersion, extension, classifier, snapshot, version, file);
}
}
7 changes: 2 additions & 5 deletions src/test/integration/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
<groupId>org.reficio</groupId>
<artifactId>p2-maven-plugin</artifactId>
<version>@project.version@</version>
<configuration>
<providerSelection>1.5</providerSelection>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand All @@ -67,9 +64,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
<version>3.2.0</version>
<configuration>
<source>1.4</source>
<source>1.7</source>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit df26dba

Please sign in to comment.