Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#85 Consider ci-friendly-maven also for archetype #342

Merged
merged 6 commits into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/server/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Drevision=0.0.1 -Dchangelist=-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@
<include>.gitignore</include>
</includes>
</fileSet>
</fileSets>
<fileSet packaged="false" filtered="true" encoding="UTF-8">
<directory>.mvn</directory>
<includes>
<include>**/*.*</include>
</includes>
</fileSet>
</fileSets>
<modules>
<module id="server" dir="server" name="server">
<fileSets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Drevision=0.0.1 -Dchangelist=-SNAPSHOT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An archetype can take a version as argument. That is available via ${version} variable.
It will now be ignored and the initial version is hardcoded to this 0.0.1-SNAPSHOT.
As ${version} can also be 1.0.0-SNAPSHOT we can not easily do

-Drevision=${version} -Dchangelist=-SNAPSHOT

As this would then result in 1.0.0-SNAPSHOT-SNAPSHOT.
However, as a nice to have, we could check if via velocity macros it is possible to strip out a potential -SNAPSHOT from ${version}. If that is possible, we should use ${version} to make it perfect.
However, for me also fine to approve and merge like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting is done..

version passing as an argument would be really nice..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for formatting. To prevent blocking this PR, I will merge it now.
Can you please create a new issue for the nice-to-have improvement to put the version here and research velocity macro syntax to remove potential -SNAPSHOT suffix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #346 created.

is it okay to directly place the version to app.version properties ... like below

#if($version)
<app.version>${version}</app.version>
#else
<app.version>${revision}${changelist}</app.version>
#end

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
<version>${app.version}</version>
</parent>
<artifactId>${rootArtifactId}-batch</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
<version>${app.version}</version>
</parent>
<artifactId>${rootArtifactId}-api</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
<version>${app.version}</version>
</parent>
<artifactId>${rootArtifactId}-core</artifactId>
<packaging>jar</packaging>
Expand Down
22 changes: 12 additions & 10 deletions templates/server/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<groupId>${groupId}</groupId>
<version>${version}</version>
<version>${app.version}</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>Application based on the devon4j.</description>
Expand All @@ -19,17 +19,18 @@
<jackson.version>$[jackson.version]</jackson.version> <!-- Overriding Jackson for fixing vulnerabilities -->
<guava.version>$[guava.version]</guava.version>
<devonfw.test.excluded.groups>system</devonfw.test.excluded.groups>
<app.version>${revision}${changelist}</app.version>
</properties>

<modules>
<module>api</module>
<module>core</module>
#if ($earProjectName != '.')
#if ($earProjectName != '.')
<module>${earProjectName}</module>
#end
#if ($batch == 'batch')
#end
#if ($batch == 'batch')
<module>batch</module>
#end
#end
Comment on lines -27 to +33
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems Eclipse formatter also indents velocity macros.
We need to check the generated output as this might break the indentation there.
I hoped eclipse would leave things like this as is...
If this is a problem in the resulting pom we can fix in the new story for improvement.

<module>server</module>
</modules>

Expand All @@ -50,7 +51,7 @@
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependency>
<!-- Library with general utilities -->
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -196,7 +197,7 @@
<version>$[maven.javadoc.plugin.version]</version>
<configuration>
<!-- http://jira.codehaus.org/browse/MJAVADOC-308 -->
<!--<maxmemory>5048m</maxmemory>-->
<!--<maxmemory>5048m</maxmemory> -->
<notree>true</notree>
<show>protected</show>
<encoding>${project.reporting.outputEncoding}</encoding>
Expand Down Expand Up @@ -287,7 +288,8 @@
<useMissingFile>true</useMissingFile>
<failOnMissing>true</failOnMissing>
<licenseMerges>
<licenseMerge>Apache Software License, Version 2.0|The Apache Software License, Version 2.0|Apache 2.0|Apache License, Version 2.0</licenseMerge>
<licenseMerge>Apache Software License, Version 2.0|The Apache Software License, Version 2.0|Apache
2.0|Apache License, Version 2.0</licenseMerge>
</licenseMerges>
</configuration>
</plugin>
Expand Down Expand Up @@ -329,7 +331,7 @@
<profile>
<id>moduletest</id>
<properties>
<devonfw.test.excluded.groups>component,subsystem,system</devonfw.test.excluded.groups>
<devonfw.test.excluded.groups>component,subsystem,system</devonfw.test.excluded.groups>
</properties>
</profile>
<profile>
Expand All @@ -340,7 +342,7 @@
</profile>
<profile>
<id>subsystemtest</id>
<properties>
<properties>
<devonfw.test.excluded.groups>system</devonfw.test.excluded.groups>
</properties>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
<version>${app.version}</version>
</parent>
<artifactId>${rootArtifactId}-server</artifactId>
<packaging>war</packaging>
Expand Down