Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into kaklakariada/issue479
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Oct 24, 2023
2 parents 0f1610a + 51f70f8 commit e214bcf
Show file tree
Hide file tree
Showing 31 changed files with 570 additions and 479 deletions.
420 changes: 190 additions & 230 deletions dependencies.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

132 changes: 132 additions & 0 deletions doc/changes/changes_2.9.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Project Keeper 2.9.13, released 2023-10-24

Code name: Remove Enforcer Plugin

## Summary

This release removes plugins from the generated `dependencies.md` file that are defined by Maven itself. This avoids a dependency on the Maven version which allows using any version you want.

The release also reduces build verbosity by setting the `quiet` option of `maven-javadoc-plugin` to `true`.

## Features

* #480: Removed indirect plugins from `dependencies.md` & remove enforcer plugin

## Dependency Updates

### Project-Keeper Shared Model Classes

#### Compile Dependency Updates

* Updated `jakarta.json:jakarta.json-api:2.1.2` to `2.1.3`

#### Test Dependency Updates

* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`

### Project Keeper Core

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13`

#### Runtime Dependency Updates

* Updated `com.exasol:project-keeper-java-project-crawler:2.9.12` to `2.9.13`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.12` to `2.9.13`
* Updated `org.mockito:mockito-junit-jupiter:5.5.0` to `5.6.0`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`

### Project Keeper Command Line Interface

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.12` to `2.9.13`
* Updated `org.apache.maven:maven-model:3.9.4` to `3.9.5`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.12` to `2.9.13`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`

### Project Keeper Maven Plugin

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.12` to `2.9.13`

#### Test Dependency Updates

* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`

### Project Keeper Java Project Crawler

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13`

#### Test Dependency Updates

* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0`
* Added `org.mockito:mockito-junit-jupiter:5.6.0`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0`
* Updated `org.apache.maven.plugins:maven-plugin-plugin:3.9.0` to `3.10.1`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`

### Project Keeper Shared Test Setup

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13`

#### Plugin Dependency Updates

* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1`
* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0`
* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1`
* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11`
* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594`
16 changes: 15 additions & 1 deletion doc/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Needs: impl, utest, itest

### Dependencies.md File Validator

`dsn~depnedency.md-file-validator~1`
`dsn~dependency.md-file-validator~1`

For validating the `dependencies.md` file we first generate the expected content and then compare the actual file with the expected content.

Expand All @@ -166,6 +166,20 @@ Covers:

Needs: impl, itest

#### Excluding Implicit Plugins from Dependencies.md

`dsn~dependency.md-file-validator-excludes-implicit-plugins~1`

PK excludes implicit plugins from `dependencies.md`.

Rationale:

Maven implicitly adds plugins like `org.apache.maven.plugins:maven-clean-plugin` due to the Maven lifecycle. The version of these plugins depends on the Maven version. Each plugin version defines its own name and license which is included in `dependencies.md`. That means the content of `dependencies.md` depends on the Maven version, causing build failures when using a different Maven version, see [issue #436](https://github.com/exasol/project-keeper/issues/436).

One workaround is pinning the Maven version using `maven-enforcer-plugin` but this causes problems on developer's machines. That's why we decided to remove these implicit plugins from `dependencies.md`.

Needs: impl, utest, itest

### Readme.md File Validator

`dsn~readme-validator~1`
Expand Down
31 changes: 6 additions & 25 deletions maven-project-crawler/pk_generated_parent.pom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion maven-project-crawler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.exasol</groupId>
<artifactId>maven-plugin-integration-testing</artifactId>
Expand All @@ -91,7 +96,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.9.0</version>
<version>3.10.1</version>
</plugin>
<plugin>
<groupId>org.basepom.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void execute() {
final MavenProject project = readProject(mavenProjectReader, path);
final DependencyChangeReport dependencyChangeReport = new DependencyUpdateReader(mavenProjectReader,
project.getBasedir().toPath(), project.getModel()).readDependencyChanges();
final ProjectDependencies dependencies = new ProjectDependencyReader(modelFromRepositoryReader)
.readDependencies(project);
final ProjectDependencies dependencies = new ProjectDependencyReader(modelFromRepositoryReader, project)
.readDependencies();
final CrawledMavenProject crawledMavenProject = new CrawledMavenProject(dependencyChangeReport,
dependencies, project.getVersion());
crawledProjects.put(path, crawledMavenProject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ private Model getOldModel() {
if (lastReleasesPomFile.isPresent()) {
return parseOldPomFile(lastReleasesPomFile.get());
} else {
final var emptyModel = new Model();
final var build = new Build();
emptyModel.setBuild(build);
return emptyModel;
return emptyModel();
}
} finally {
deleteTempDir(tempDirectory);
}
}

private Model emptyModel() {
final var emptyModel = new Model();
emptyModel.setBuild(new Build());
return emptyModel;
}

private void deleteTempDir(final Path tempDirectory) {
try {
if (Files.isDirectory(tempDirectory)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
import com.exasol.projectkeeper.shared.repository.TaggedCommit;

/**
* This class reads the pom file of the latest previous release on the current branch.
* This class reads the pom file including its parent POMs of the latest previous release on the current branch.
*/
public class LastReleasePomFileReader {
private static final Logger LOGGER = Logger.getLogger(LastReleasePomFileReader.class.getName());

/**
* Copy pom.xml file from a given git release tag to another directory. If the pom file specifies a parent with
* relative path, this method extracts it too.
* Copy {@code pom.xml} file from a given git release tag to another directory. If the pom file specifies a parent
* with relative path, this method extracts it too.
*
* @param projectDirectory projects root directory
* @param relativePathToPom path to the pom file to extract (relative to the {@code projectDirectory})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ private List<Dependency> filterDependenciesByScope(final Model model, final Stri
.collect(Collectors.toList());
}

private List<Dependency> convertPluginsToDependencies(final Model oldModel) {
return oldModel.getBuild().getPlugins().stream().map(this::convertPluginToDependency)
private List<Dependency> convertPluginsToDependencies(final Model model) {
return model.getBuild().getPlugins().stream() //
.map(this::convertPluginToDependency) //
.collect(Collectors.toList());
}

Expand Down
Loading

0 comments on commit e214bcf

Please sign in to comment.