Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Update mojo-parent to 76, Maven 3.6.3, JDK 8 and GitHub Actions (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleErwin authored Jul 21, 2023
1 parent 5b37ce2 commit 62181aa
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 78 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: GitHub CI

on: [push, pull_request]

jobs:
build:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
with:
os-matrix: '[ "ubuntu-latest" ]'
maven-matrix: '[ "3.6.3", "3.9.3" ]'
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MojoHaus RPM Maven Plugin

This is the [rpm-maven-plugin](http://www.mojohaus.org/rpm-maven-plugin/).
[![Build Status](https://travis-ci.org/mojohaus/rpm-maven-plugin.svg?branch=master)](https://travis-ci.org/mojohaus/rpm-maven-plugin)

[![GitHub CI](https://github.com/mojohaus/rpm-maven-plugin/actions/workflows/maven.yml/badge.svg)](https://github.com/mojohaus/rpm-maven-plugin/actions/workflows/maven.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.codehaus.mojo/rpm-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.codehaus.mojo/rpm-maven-plugin)

## Releasing
Expand Down
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Default provider VirtualBox
config.vm.box = "CentOS-6.5-x86_64"
config.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box"
config.vm.box = "ubuntu/jammy64"

config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
Expand All @@ -15,6 +14,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
prl.customize ["set", :id, "--memsize", 1024]
prl.customize ["set", :id, "--cpus", 2]
end
config.vm.synced_folder ".", "/vagrant"

config.vm.provision "shell", path: "provision.sh"
end
41 changes: 25 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mojo-parent</artifactId>
<version>38</version>
<version>76</version>
</parent>

<artifactId>rpm-maven-plugin</artifactId>
Expand Down Expand Up @@ -116,8 +116,8 @@
</scm>

<properties>
<mavenVersion>2.2.1</mavenVersion>
<mojo.java.target>1.6</mojo.java.target>
<mavenVersion>3.6.3</mavenVersion>
<mojo.java.target>8</mojo.java.target>
<scmpublish.content>${project.build.directory}/staging/rpm-maven-plugin</scmpublish.content>
</properties>

Expand All @@ -126,46 +126,56 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<artifactId>maven-settings</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>3.1.1</version>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.25</version>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>3.6.0</version>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
Expand All @@ -174,9 +184,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<version>1.4</version>
<version>2.0</version>
</dependency>
</dependencies>

Expand All @@ -201,10 +211,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
Expand Down Expand Up @@ -236,6 +242,9 @@
<gpg.homedir>${project.build.testOutputDirectory}/gnupg</gpg.homedir>
</properties>
<!-- <pomIncludes> <pomInclude>rpm-sign*/pom.xml</pomInclude> </pomIncludes> -->
<pomExcludes>
<pomExclude>rpm-dirmode/pom.xml</pomExclude>
</pomExcludes>
<goals>
<goal>clean</goal>
<goal>install</goal>
Expand Down
14 changes: 8 additions & 6 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -o nounset

function install {
rpm -qa | grep -q $1
dpkg -l $1
if [ $? -ne 0 ]; then
echo "Installing $1 ..."
sudo yum install -y $1
sudo apt-get install -y $1
fi
}

Expand All @@ -14,17 +14,19 @@ function install_mvn {
if [ $? -ne 0 ]; then
echo "Installing Apache Maven $1"
cd /tmp &&
wget -q http://archive.apache.org/dist/maven/binaries/apache-maven-$1-bin.tar.gz &&
wget -q http://archive.apache.org/dist/maven/maven-3/$1/binaries/apache-maven-$1-bin.tar.gz &&
cd /opt &&
sudo tar -xzf /tmp/apache-maven-$1-bin.tar.gz

echo "export PATH=/opt/apache-maven-$1/bin:$PATH" >> ~vagrant/.bashrc
fi
}

install java-1.7.0-openjdk-devel
install rpm-build
apt-get update

install openjdk-17-jdk
install rpm
install wget
install_mvn 2.2.1
install_mvn 3.9.3

echo "Provisioning completed."
2 changes: 2 additions & 0 deletions src/it/rpm-artifact/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
Expand Down
2 changes: 1 addition & 1 deletion src/it/rpm-dirmode/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals = clean install
invoker.goals = clean install
2 changes: 1 addition & 1 deletion src/it/rpm-dirmode/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ lines = proc.in.text.readLines()
if (lines.size() != 38)
throw new AssertionError("Expected: 38 file/dir/links but got: ${lines.size()}")

return true
return true
2 changes: 2 additions & 0 deletions src/it/rpm-reactor/rpm-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down
12 changes: 12 additions & 0 deletions src/it/rpm-reactor/rpm-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,16 @@
<version>1.0</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
2 changes: 2 additions & 0 deletions src/it/rpm-sign-with-keyname-lookup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<disableSigning>true</disableSigning>
</properties>

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/codehaus/mojo/rpm/AbstractRPMMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
import org.apache.maven.shared.filtering.FilterWrapper;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.MavenResourcesExecution;
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.mojo.rpm.VersionHelper.RPMVersionableMojo;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.Os;
Expand Down Expand Up @@ -107,8 +107,8 @@ public abstract class AbstractRPMMojo
* <p>
* For passivity purposes, a value of <code>true</code> or <code>false</code> will indicate whether the <a
* href="http://plexus.codehaus.org/plexus-utils/apidocs/org/codehaus/plexus/util/Os.html#OS_ARCH">architecture</a>
* of the build machine will be used. Any other value (such as <tt>x86_64</tt>) will set the architecture of the rpm
* to <tt>x86_64</tt>.
* of the build machine will be used. Any other value (such as {@code x86_64}) will set the architecture of the rpm
* to {@code x86_64}.
* </p>
* <p>
* This can also be used in conjunction with <a href="source-params.html#targetArchitecture">Source
Expand Down Expand Up @@ -702,7 +702,7 @@ public abstract class AbstractRPMMojo
private RPMHelper helper;

/**
* The {@link FileUtils.FilterWrapper filter wrappers} to use for file filtering.
* The {@link FilterWrapper filter wrappers} to use for file filtering.
*
* @since 2.0
* @see #mavenFileFilter
Expand Down Expand Up @@ -822,7 +822,7 @@ protected void afterExecution()
}

/**
* Provides an opportunity for subclasses to provide an additional classifier for the rpm workarea.<br/>
* Provides an opportunity for subclasses to provide an additional classifier for the rpm workarea.<br>
* By default this implementation returns {@code null}, which indicates that no additional classifier should be
* used.
*
Expand All @@ -837,7 +837,7 @@ String getClassifier()
/**
* Returns the generated rpm {@link File}.
*
* @return The generated rpm <tt>File</tt>.
* @return The generated rpm {@link File}.
*/
protected File getRPMFile()
{
Expand Down Expand Up @@ -1543,7 +1543,7 @@ final File getRPMBuildroot()
}

/**
* @inheritDoc
* {@inheritDoc}
*/
public final String getVersion()
{
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/codehaus/mojo/rpm/BaseTrigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* under the License.
*/

import org.apache.maven.shared.filtering.FilterWrapper;
import org.apache.maven.shared.utils.io.FileUtils;

import java.io.IOException;
Expand Down Expand Up @@ -90,13 +91,13 @@ protected String buildScriptletLine( String directive )
}

/**
* Writes the complete trigger directive. Use instead of {@link #write(PrintWriter, String)}.
* Writes the complete trigger directive. Use instead of {@link #write(PrintWriter, String, List)}.
*
* @param writer {@code PrintWriter} to write the trigger directive to.
* @param filterWrappers The filter wrappers to be applied when writing the content.
* @throws IOException
* @throws IOException if an I/IO error occurs
*/
protected void writeTrigger( PrintWriter writer, final List<FileUtils.FilterWrapper> filterWrappers )
protected void writeTrigger( PrintWriter writer, final List<FilterWrapper> filterWrappers )
throws IOException
{
write( writer, getDirective(), filterWrappers );
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/codehaus/mojo/rpm/Dependency.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean getStripVersion()
/**
* Set the stripVersion property
*
* @param stripVersion
* @param stripVersion the stripVersion property to set
* @throws MojoExecutionException if the parse fails
*/
public void setStripVersion( boolean stripVersion )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import java.io.IOException;
import java.util.List;

import org.apache.maven.shared.filtering.FilterWrapper;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper;
import org.codehaus.plexus.archiver.ArchiveEntry;
import org.codehaus.plexus.archiver.dir.DirectoryArchiver;
import org.codehaus.plexus.archiver.util.ArchiveEntryUtils;
Expand Down
Loading

0 comments on commit 62181aa

Please sign in to comment.