Skip to content

Commit

Permalink
#501 Document usage for non-Maven projects (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada authored Nov 22, 2023
1 parent a0900a3 commit f01ac02
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 34 deletions.
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Project Keeper Maven Plugin

[![Build Status](https://github.com/exasol/project-keeper/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/project-keeper/actions/workflows/ci-build.yml)
Project keeper core: [![Maven Central – Project keeper core](https://img.shields.io/maven-central/v/com.exasol/project-keeper-core)](https://search.maven.org/artifact/com.exasol/project-keeper-core), Project Keeper Command Line Interface: [![Maven Central – Project Keeper Command Line Interface](https://img.shields.io/maven-central/v/com.exasol/project-keeper-cli)](https://search.maven.org/artifact/com.exasol/project-keeper-cli), Project keeper maven plugin: [![Maven Central – Project keeper maven plugin](https://img.shields.io/maven-central/v/com.exasol/project-keeper-maven-plugin)](https://search.maven.org/artifact/com.exasol/project-keeper-maven-plugin)
Project Keeper Core: [![Maven Central – Project Keeper Core](https://img.shields.io/maven-central/v/com.exasol/project-keeper-core)](https://search.maven.org/artifact/com.exasol/project-keeper-core), Project Keeper Command Line Interface: [![Maven Central – Project Keeper Command Line Interface](https://img.shields.io/maven-central/v/com.exasol/project-keeper-cli)](https://search.maven.org/artifact/com.exasol/project-keeper-cli), Project Keeper Maven plugin: [![Maven Central – Project Keeper Maven plugin](https://img.shields.io/maven-central/v/com.exasol/project-keeper-maven-plugin)](https://search.maven.org/artifact/com.exasol/project-keeper-maven-plugin)

This maven plugin checks and unifies the project's structure according to the Exasol integration team's repository standards.

Expand Down Expand Up @@ -43,13 +43,25 @@ sources:
### Sources
For project-keeper a 'source' is a project inside a repository. For example a maven-project. In the future project-keeper will be able to crawl multiple source-projects from one repository. However, for now, you must specify exactly one maven source.
For PK a 'source' is a project inside a repository, e.g. a Maven module. PK is able to crawl multiple source projects from one repository.
Supported project types:
* `maven`: Projects with maven build. The path must point to the `pom.xml` file.
* `maven`: Projects with Maven build. The path must point to the `pom.xml` file
* `golang`: Go projects. Path must point to the `go.mod` file
* `npm`: NPM based JavaScript or TypeScript projects. Path must point to the `package.json` file

If you have multiple sources in a project, project-keeper will list all of them as badges in the project's `README.md`. If you want to hide one source, you can set `advertise: false` for this source.
If you have multiple sources in a project, PK will list all of them as badges in the project's `README.md`. If you want to hide one source, you can set `advertise: false` for this source.

### Project Keeper Verify for non-Maven Projects

Maven projects use PK's Maven plugin to run PK verify during the `verify` Maven lifecycle. To run PK verify also for other projects, PK generates GitHub workflow `.github/workflows/project-keeper-verify.yml` and shell script `.github/workflows/project-keeper.sh`. Both files are only generated if there is **no** Maven module in the project root, i.e. there is no Maven source with `path: pom.xml` in `.project-keeper.yml`.

You can run PK fix for non-Maven projects with the following command:

```sh
./.github/workflows/project-keeper.sh fix
```

### Modules

Expand All @@ -66,7 +78,7 @@ This plugin provides different template modules for different kinds of projects.

### Excluding Findings

Using the `excludes` tag you can tell project-keeper to ignore some error-messages:
Using the `excludes` tag you can tell PK to ignore some error-messages:

```yml
sources:
Expand All @@ -77,6 +89,7 @@ sources:
excludes:
- "E-PK-CORE-15: Missing maven plugin org.codehaus.mojo:versions-maven-plugin."
- regex: "E-PK-CORE-16: .*"
- regex: "W-PK-CORE-151: Pom file .* contains no reference to project-keeper-maven-plugin."
```

Note that you can also use regular expressions (see example above). If a finding is excluded it will not show up on validation and will not be fixed.
Expand All @@ -87,7 +100,7 @@ You can define excludes globally (like `E-PK-CORE-15` and `E-PK-CORE-16` in the

Some dependencies define invalid / outdated links to their project homepage. PK writes these links to the `dependencies.md` file. This will make the link checker break the build since a project file contains broken links.

The best way to solve this is to open an issue / pull request at the projects that contain the wrong url. Since this is, however not always possible you can, as a mitigation, also define a replacement for links:
The best way to solve this is to open an issue / pull request at the projects that contain the wrong URL. Since this is, however not always possible you can, as a mitigation, also define a replacement for links:

```yml
sources:
Expand All @@ -99,11 +112,11 @@ linkReplacements:

The syntax for a replacement is `broken-url|replacement`.

Project-keeper will then use the replacement in the `dependencies.md` file instead of the original url.
PK will then use the replacement in the `dependencies.md` file instead of the original URL.

### CI Build Configuration

PK allows configuring the generated CI-Build workflow scripts using the `build` section in file `.project-keeper.yml`.
PK allows customizing the generated CI-Build workflow scripts using the `build` section in file `.project-keeper.yml` using the following options:

#### GitHub Runner Operating System

Expand Down Expand Up @@ -142,13 +155,13 @@ Sonar will only run for the first version in the list.

## POM File

For maven projects, project-keeper generates a `pk_generated_parent.pom` file. This file contains all the required plugins, dependencies and configurations. PK configures your `pom.xml` to use this file as a parent pom. By that, your `pom.xml` inherits all the configuration.
For Maven projects, PK generates a `pk_generated_parent.pom` file. This file contains all the required plugins, dependencies and configurations. PK configures your `pom.xml` to use this file as a parent pom. By that, your `pom.xml` inherits all the configuration.

The `pk_generated_parent.pom` file is required during the build and must be checked into version control. Run `mvn project-keeper:fix` to update the file instead of editing it manually.

### Using a Parent Pom
### Using a Parent POM

If you want to use a parent pom for your project, that's not possible directly since your `pom.xml` must use the `pk_generated_parent.pom` as parent.
If you want to use a parent POM for your project, that's not possible directly since your `pom.xml` must use the `pk_generated_parent.pom` as parent.

Instead, configure the parent in the PK config:

Expand Down
14 changes: 7 additions & 7 deletions dependencies.md

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

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.

81 changes: 81 additions & 0 deletions doc/changes/changes_2.9.17.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Project Keeper 2.9.17, released 2023-??-??

Code name:

## Summary

This release adds documentation describing how Project Keeper works with non-Maven projects.

## Documentation

* #501: Documented usage for non-Maven projects

## Dependency Updates

### Project Keeper Shared Model Classes

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`

### Project Keeper Core

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.16` to `2.9.17`

#### Runtime Dependency Updates

* Updated `com.exasol:project-keeper-java-project-crawler:2.9.16` to `2.9.17`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.16` to `2.9.17`

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`

### Project Keeper Command Line Interface

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.16` to `2.9.17`

#### Test Dependency Updates

* Updated `com.exasol:project-keeper-shared-test-setup:2.9.16` to `2.9.17`

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`

### Project Keeper Maven Plugin

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-core:2.9.16` to `2.9.17`

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`

### Project Keeper Java Project Crawler

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.16` to `2.9.17`

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`

### Project Keeper Shared Test Setup

#### Compile Dependency Updates

* Updated `com.exasol:project-keeper-shared-model-classes:2.9.16` to `2.9.17`

#### Plugin Dependency Updates

* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.1` to `2.16.2`
2 changes: 1 addition & 1 deletion maven-project-crawler/pk_generated_parent.pom

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

2 changes: 1 addition & 1 deletion maven-project-crawler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>project-keeper-java-project-crawler</artifactId>
<packaging>maven-plugin</packaging>
<name>Project keeper Java project crawler</name>
<name>Project Keeper Java project crawler</name>
<description>Crawler for maven projects.</description>
<parent>
<relativePath>./pk_generated_parent.pom</relativePath>
Expand Down
4 changes: 2 additions & 2 deletions parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>project-keeper-parent-pom</artifactId>
<packaging>pom</packaging>
<version>${revision}</version>
<name>Project keeper parent pom</name>
<name>Project Keeper parent pom</name>
<description>This tool checks and unifies a project's structure according to the Exasol integration team's
repository standards.
</description>
Expand All @@ -28,7 +28,7 @@
</repository>
</distributionManagement>
<properties>
<revision>2.9.16</revision>
<revision>2.9.17</revision>
<maven.version>3.9.5</maven.version>
<minimum.maven.version>3.6.3</minimum.maven.version>
<junit.version>5.10.1</junit.version>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<module>maven-project-crawler</module>
<module>project-keeper-maven-plugin</module>
</modules>
<name>Project Keeper Project</name>
<name>Project Keeper Root Project</name>
<build>
<plugins>
<plugin>
Expand All @@ -40,7 +40,7 @@
<plugin>
<groupId>org.itsallcode</groupId>
<artifactId>openfasttrace-maven-plugin</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>
<executions>
<execution>
<id>trace-requirements</id>
Expand Down
2 changes: 1 addition & 1 deletion project-keeper-cli/pk_generated_parent.pom

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

2 changes: 1 addition & 1 deletion project-keeper-maven-plugin/pk_generated_parent.pom

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

4 changes: 2 additions & 2 deletions project-keeper-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>project-keeper-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Project keeper maven plugin</name>
<description>This maven plugin runs project-keeper.</description>
<name>Project Keeper Maven plugin</name>
<description>This Maven plugin runs Project Keeper.</description>
<url>https://github.com/exasol/project-keeper/</url>
<parent>
<relativePath>./pk_generated_parent.pom</relativePath>
Expand Down
2 changes: 1 addition & 1 deletion project-keeper/pk_generated_parent.pom

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

2 changes: 1 addition & 1 deletion project-keeper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>project-keeper-core</artifactId>
<packaging>jar</packaging>
<name>Project keeper core</name>
<name>Project Keeper Core</name>
<description>Project keeper is a tool that verifies and fixes project setups.</description>
<parent>
<relativePath>./pk_generated_parent.pom</relativePath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.16.1</version>
<version>2.16.2</version>
<executions>
<execution>
<id>display-updates</id>
Expand Down
2 changes: 1 addition & 1 deletion shared-model-classes/pk_generated_parent.pom

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

2 changes: 1 addition & 1 deletion shared-model-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>Classes that need to be shared between different modules of project-keeper.</description>
<modelVersion>4.0.0</modelVersion>
<artifactId>project-keeper-shared-model-classes</artifactId>
<name>Project-Keeper shared model classes</name>
<name>Project Keeper shared model classes</name>
<url>https://github.com/exasol/project-keeper/</url>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion shared-test-setup/pk_generated_parent.pom

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

0 comments on commit f01ac02

Please sign in to comment.