Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Sep 2, 2024
2 parents 9b0e9a1 + d65de52 commit b3f2248
Show file tree
Hide file tree
Showing 37 changed files with 2,464 additions and 138 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/find-and-replace-maven-plugin/releases/latest)"
required: true
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/find-and-replace-maven-plugin/issues) or [closed](https://github.com/xdev-software/find-and-replace-maven-plugin/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/find-and-replace-maven-plugin/issues) or [closed](https://github.com/xdev-software/find-and-replace-maven-plugin/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/find-and-replace-maven-plugin/issues) or [closed](https://github.com/xdev-software/find-and-replace-maven-plugin/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ on:

env:
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo

jobs:
build:
Expand Down Expand Up @@ -63,13 +62,6 @@ jobs:
exit 1
fi
- name: Upload demo files
uses: actions/upload-artifact@v4
with:
name: demo-files-java-${{ matrix.java }}
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
if-no-files-found: error

checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ jobs:
## Installation
Add the following lines to your pom:
```XML
<dependency>
<plugin>
<groupId>software.xdev</groupId>
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId>
<version>${{ steps.version.outputs.release }}</version>
</dependency>
</plugin>
```
publish-maven:
Expand Down
16 changes: 0 additions & 16 deletions .run/Run Demo.run.xml

This file was deleted.

50 changes: 50 additions & 0 deletions .run/Run Sandbox.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Sandbox" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings">
<MavenRunnerSettings>
<option name="delegateBuildToMaven" value="false" />
<option name="environmentProperties">
<map />
</option>
<option name="jreName" value="#USE_PROJECT_JDK" />
<option name="mavenProperties">
<map />
</option>
<option name="passParentEnv" value="true" />
<option name="runMavenInBackground" value="true" />
<option name="skipTests" value="true" />
<option name="vmOptions" value="" />
</MavenRunnerSettings>
</option>
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="package" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" />
<option name="profilesMap">
<map>
<entry key="test-sandbox" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## 1.0.2
* Fix ``baseDir`` detection not working in multi module project
* Improved logging
* Updated various dependencies

## 1.0.1
* Updated docs
* Updated various dependencies

## 1.0.0
<i>Initial release</i>
* Forked from [floverfelt/find-and-replace-maven-plugin](https://github.com/floverfelt/find-and-replace-maven-plugin)
* Broken down into multiple goals #6
* ``directory-name``: Allows replacing directory names
* ``file-names``: Allows replacing file names
* ``file-contents``: Allows replacing file contents
* New config option: ``replaceLineBased`` -> If set to ``false`` the whole file is replaced, see docs
* Use ``System.lineSeparator()`` instead of ``\n``
* ``find-and-replace``
* Same as in the old plugin
* Deprecated only exists for compatibility reasons
* Added possibility for empty ``replacementValue`` #3
* Added option to replace multiple lines #2
* Remove not needed dependencies / Fixed maven warnings #1
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ You should have the following things installed:
* Ensure that the JDK/Java-Version is correct


## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/find-and-replace-maven-plugin/release.yml?branch=master)](https://github.com/xdev-software/find-and-replace-maven-plugin/actions/workflows/release.yml)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Consider doing a [test-deployment](https://github.com/xdev-software/find-and-replace-maven-plugin/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
identification within third-party archives.

Copyright 2024 XDEV Software
Copyright 2022 floverfelt

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
104 changes: 98 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,104 @@
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/find-and-replace-maven-plugin?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/find-and-replace-maven-plugin)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/find-and-replace-maven-plugin/check-build.yml?branch=develop)](https://github.com/xdev-software/find-and-replace-maven-plugin/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_find-and-replace-maven-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_find-and-replace-maven-plugin)
[![Plugin docs](https://img.shields.io/badge/Plugin-docs-017cee?logo=apachemaven)](https://xdev-software.github.io/find-and-replace-maven-plugin/plugin-info)

# template-placeholder
# find-and-replace-maven-plugin

A maven plugin for replacing content in files, filenames and directories.

> [!NOTE]
> This is a fork of [floverfelt/find-and-replace-maven-plugin](https://github.com/floverfelt/find-and-replace-maven-plugin) with some [additional functionality](CHANGELOG.md#100).
## Usage
A short usage guide is available [in the plugin docs](https://xdev-software.github.io/find-and-replace-maven-plugin/plugin-info).

Example: Replace underscores with hyphen
```xml
<plugin>
<groupId>software.xdev</groupId>
<artifactId>find-and-replace-maven-plugin</artifactId>
<executions>
<execution>
<id>replace-underscore-with-hyphen</id>
<phase>process-sources</phase>
<goals>
<goal>file-contents</goal>
</goals>
<configuration>
<baseDir>testing/</baseDir>
<fileMask>test.txt</fileMask>
<findRegex>_</findRegex>
<replaceValue>-</replaceValue>
</configuration>
</execution>
</executions>
</plugin>
```

<details><summary>Replace contents of auto-generated files (OpenAPI generator)</summary>

```xml
<plugin>
<groupId>software.xdev</groupId>
<artifactId>find-and-replace-maven-plugin</artifactId>
<executions>
<execution>
<!-- Remove so that we don't need additional dependency -->
<id>remove-unused-import-com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</id>
<phase>process-sources</phase>
<goals>
<goal>file-contents</goal>
</goals>
<configuration>
<baseDir>${generatedDirRelative}/software/xdev/${componentName}/client/</baseDir>
<fileMask>ApiClient.java</fileMask>
<!-- @formatter:off DO NOT INTRODUCE LINE BREAK -->
<findRegex>^import com\.fasterxml\.jackson\.jaxrs\.json\.JacksonJsonProvider;(\r?\n)</findRegex>
<!-- @formatter:on -->
<replaceLineBased>false</replaceLineBased>
</configuration>
</execution>
<execution>
<!-- Changes with each generator version -->
<id>remove-generated-annotation</id>
<phase>process-sources</phase>
<goals>
<goal>file-contents</goal>
</goals>
<configuration>
<baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir>
<recursive>true</recursive>
<fileMask>.java</fileMask>
<findRegex>^@jakarta\.annotation\.Generated.*(\r?\n)</findRegex>
<replaceAll>false</replaceAll>
<replaceLineBased>false</replaceLineBased>
</configuration>
</execution>
<execution>
<!-- Requiring Java serialization indicates a serious misuse of the API -->
<id>remove-serialVersionUID</id>
<phase>process-sources</phase>
<goals>
<goal>file-contents</goal>
</goals>
<configuration>
<baseDir>${generatedDirRelative}/software/xdev/${componentName}/</baseDir>
<recursive>true</recursive>
<fileMask>.java</fileMask>
<findRegex>^.*serialVersionUID.*(\r?\n)(\s*\r?\n)?</findRegex>
<replaceAll>false</replaceAll>
<replaceLineBased>false</replaceLineBased>
</configuration>
</execution>
</executions>
</plugin>
```

</details>

## Installation
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
[Installation guide for the latest release](https://github.com/xdev-software/find-and-replace-maven-plugin/releases/latest#Installation)

## Support
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
Expand All @@ -15,4 +107,4 @@ If you need support as soon as possible and you can't wait for any pull request,
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

## Dependencies and Licenses
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/find-and-replace-maven-plugin/dependencies)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/find-and-replace-maven-plugin/security/advisories/new).
Loading

0 comments on commit b3f2248

Please sign in to comment.