jgitver / jgitver/jgitver-maven-plugin

jgitver packaging in submodules

Open
#97 7 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Groovy
Stars
166
Forks
42
PR merge metrics
No merged PRs in 30d

Description

## Issue

**version**:1.3.0

**usage context**: Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)

**Problem description**:

- When using jgitver on a multimodule project it fails to package the correct version in submodules.

Steps to reproduce:

1) Create archetype demo1 project as from the documentation
2) Verify the correct version in target/demo1....jar:/META-INF/....pom.xml
3) Move demo1 to a sub directory and create a new parent module
4) Retry the verification in demo1/target/demo1...jar:/META-INF/...pom.xml

Example below:


```
mvn archetype:generate -B \
-DarchetypeCatalog=internal \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DarchetypeVersion=1.1 \
-DgroupId=fr.brouillard.jgitver.demos \
-DartifactId=demo1 \
-Dpackage=fr.brouillard.jgitver.demos \
-Dversion=0

cd demo1

git init
git add .
git commit -m "inital commit"

// Create extensions.xml file

mvn package

jar xvf target/demo1-0.0.0-SNAPSHOT.jar META-INF/maven/fr.brouillard.jgitver.demos/demo1/pom.xml
head META-INF/maven/fr.brouillard.jgitver.demos/demo1/pom.xml

4.0.0
fr.brouillard.jgitver.demos
demo1
**0.0.0-SNAPSHOT**
demo1
http://maven.apache.org



mkdir demo1
mv src demo1
mv pom.xml demo1

**create new pom.xml:**

4.0.0

fr.brouillard.jgitver.demos
demo1-parent
0
pom


demo1




mvn package

[INFO] no suitable configuration file found, using defaults
[INFO] Scanning for projects...
[INFO] Using jgitver-maven-plugin [1.3.0] (sha1: ef8eec9f820d662e63a84f1210c377183e450cbd)
[INFO] jgitver-maven-plugin is about to change project(s) version(s)
[INFO] fr.brouillard.jgitver.demos::demo1-parent::0 -> 0.0.0-SNAPSHOT
[INFO] fr.brouillard.jgitver.demos::demo1::0 -> 0.0.0-SNAPSHOT

jar xvf demo1/target/demo1-0.0.0-SNAPSHOT.jar META-INF/maven/fr.brouillard.jgitver.demos/demo1/pom.xml
head META-INF/maven/fr.brouillard.jgitver.demos/demo1/pom.xml

4.0.0

fr.brouillard.jgitver.demos
demo1
**0**
jar

demo1

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported behavior with the generated parent pom.xml, child demo1/pom.xml, and extensions.xml setup, then inspect the packaged META-INF/maven/.../pom.xml inside demo1/target/demo1-0.0.0-SNAPSHOT.jar. Confirm that the child POM records the computed 0.0.0-SNAPSHOT version rather than the original 0, and use the Maven package output to compare standalone and multimodule builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.