apache / apache/maven-archetype

[ARCHETYPE-656] Generated archetype changes end of lines to line.separator value

Open
#874 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
148
Forks
181
Avg merge
1d 20h
Merged PRs (30d)
8

Description

**[David Matějček](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dmatej)** opened **[ARCHETYPE-656](https://issues.apache.org/jira/browse/ARCHETYPE-656?redirect=false)** and commented

https://github.com/apache/maven-archetype/blob/3a2b725198c3823fd5d7e9f88b665b2e4515a202/archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java#L741

```java
 writer.write(StringUtils.unifyLineSeparators(stringWriter.toString()));
```

This line manipulates end of line of the source.

That breaks checkstyle rules defined in the common parent of our project where we enforce just '\n'.

It would be good to have it configurable like with encoding. Now is easier to copy-paste another project than to use archetypes.

---

**Affects:** 3.2.1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in archetype-common/src/main/java/org/apache/maven/archetype/generator/DefaultFilesetArchetypeGenerator.java around line 741, where generated content is passed through StringUtils.unifyLineSeparators. Compare the requested configurability with the existing encoding configuration. Done means generated files can use a configured line separator without violating the project's enforced '\n' checkstyle rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.