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

Issue #91 : Apply properties from active profiles #141

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7681e50
Issue #91 :
lafoletc Apr 8, 2020
939c5fd
Bump jackson-databind in /src/it/projects/bom-pomElements/bom (#151)
dependabot[bot] May 20, 2020
6b5779f
Fix #140 by separating no-overwritten test into two basing on maven v…
yangnuoyu Jun 2, 2020
b99ef48
Fixes #145, #148 add codes to parse the <version> for the dependency …
yangnuoyu Jun 5, 2020
326f257
add github action build
olamy Jun 10, 2020
8dd713c
use mvnw in github actions
olamy Jun 10, 2020
f4d442f
Fixes no-overwrite test failure (#159)
yangnuoyu Jun 11, 2020
601fcc7
[maven-release-plugin] prepare release flatten-maven-plugin-1.2.3
olamy Jun 13, 2020
4930c10
[maven-release-plugin] prepare for next development iteration
olamy Jun 13, 2020
72ab808
Fix #143: Switch back to custom DefaultModelBuilder
famod Apr 27, 2020
9ea45c1
[maven-release-plugin] prepare release flatten-maven-plugin-1.2.4
olamy Jun 22, 2020
7a3a0aa
[maven-release-plugin] prepare for next development iteration
olamy Jun 22, 2020
2a2cc73
Bump jackson-databind in /src/it/projects/bom-pomElements/bom
dependabot[bot] Jun 30, 2020
6d26629
Bump jackson-databind in /src/it/projects/bom-flattenMode/bom
dependabot[bot] Jun 30, 2020
696c3e3
enable Dependabot v2
sullis Jul 3, 2020
04a3179
Merge pull request #165 from sullis/dependabot-v2
lasselindqvist Jul 4, 2020
e260eb8
Bump actions/cache from v1 to v2
dependabot[bot] Jul 4, 2020
61b70ca
Bump assertj-core from 2.0.0 to 3.16.1
dependabot[bot] Jul 4, 2020
3aebbd1
Bump mrm-maven-plugin from 1.0.0 to 1.2.0
dependabot[bot] Jul 4, 2020
1655770
add release drafter
olamy Jul 16, 2020
116b2d0
Merge pull request #170 from mojohaus/dependabot/maven/org.codehaus.m…
dependabot[bot] Jul 16, 2020
b523725
Merge pull request #166 from mojohaus/dependabot/github_actions/actio…
dependabot[bot] Jul 16, 2020
7072506
Merge pull request #168 from mojohaus/dependabot/maven/org.assertj-as…
dependabot[bot] Jul 16, 2020
7153fc4
Merge pull request #162 from mojohaus/dependabot/maven/src/it/project…
dependabot[bot] Jul 16, 2020
0d9272a
Merge pull request #163 from mojohaus/dependabot/maven/src/it/project…
dependabot[bot] Jul 16, 2020
45eb5df
fixes #160: when the direct dependency is optional, flattened its tra…
yangnuoyu Jul 16, 2020
aa6cbd5
Bump plexus-utils from 3.2.1 to 3.3.0 (#173)
dependabot[bot] Jul 23, 2020
76c8fb8
Remove first level transitive provided scope dependencies and their s…
salehsquared Aug 12, 2020
9bc7b05
Fix minor tag problem in flatten goal description (#158)
cknoblauch Aug 12, 2020
3c68683
fix used goal in the readme example (#142)
NaitYoussef Aug 12, 2020
0963e04
[maven-release-plugin] prepare release flatten-maven-plugin-1.2.5
olamy Aug 13, 2020
b57c507
[maven-release-plugin] prepare for next development iteration
olamy Aug 13, 2020
85a96b8
Issue #91 :
lafoletc Apr 8, 2020
2768cd4
Merge branch 'active-profiles-properties' of
lafoletc Nov 14, 2020
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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
57 changes: 57 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
name-template: $NEXT_MINOR_VERSION
tag-template: $NEXT_MINOR_VERSION
version-template: $MAJOR.$MINOR.$PATCH

# Emoji reference: https://gitmoji.carloscuesta.me/
categories:
- title: ":boom: Breaking changes"
labels:
- breaking
- title: 🚨 Removed
label: removed
- title: ":tada: Major features and improvements"
labels:
- major-enhancement
- major-rfe
- title: 🐛 Major bug fixes
labels:
- major-bug
- title: ⚠️ Deprecated
label: deprecated
- title: 🚀 New features and improvements
labels:
- enhancement
- feature
- rfe
- title: 🐛 Bug Fixes
labels:
- bug
- fix
- bugfix
- regression
- title: ":construction_worker: Changes for plugin developers"
labels:
- developer
# Default label used by Dependabot
- title: 📦 Dependency updates
label: dependencies
- title: 📝 Documentation updates
label: documentation
- title: 👻 Maintenance
labels:
- chore
- internal
- title: 🚦 Tests
labels:
- test
- tests
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid

template: |
<!-- Optional: add a release summary here -->
$CHANGES
52 changes: 52 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: GitHub CI

on: [push, pull_request]

jobs:
build:

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java: [8, 11, 14, 15-ea]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up cache for ~./m2/repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: maven-${{ matrix.os }}-java${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-${{ matrix.os }}-java${{ matrix.java }}-
maven-${{ matrix.os }}-

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Build with Maven
run: ./mvnw verify -e -B -V -P run-its
12 changes: 12 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.11.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This plugin generates a flattened version of your pom.xml and makes maven to ins
<executions>
<execution>
<goals>
<goal>generate</goal>
<goal>flatten</goal>
</goals>
</execution>
</executions>
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<artifactId>flatten-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Flatten Plugin</name>
<version>1.2.3-SNAPSHOT</version>
<version>1.2.6-SNAPSHOT</version>
<description>Plugin to generate flattened POM (reduced and resolved information required for consumers of maven repositories) and to use (install, sign, deploy) it instead of original pom.xml.</description>
<inceptionYear>2014</inceptionYear>
<prerequisites>
Expand Down Expand Up @@ -148,7 +148,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand All @@ -163,7 +163,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>2.0.0</version>
<version>3.16.1</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -241,7 +241,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>mrm-maven-plugin</artifactId>
<version>1.0.0</version>
<version>1.2.0</version>
<executions>
<execution>
<goals>
Expand Down
17 changes: 17 additions & 0 deletions src/it/mrm/parent-deps-1.1.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>parent-deps</artifactId>
<version>1.1</version>
<packaging>pom</packaging>

<!-- for testing purpose, normally this would be dep management -->
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/it/projects/bom-flattenMode/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.1</version>
<version>2.9.10.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/it/projects/bom-pomElements/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.1</version>
<version>2.9.10.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
14 changes: 13 additions & 1 deletion src/it/projects/external-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
</dependencies>
</dependencies>

<profiles>
<profile>
<id> test </id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>


<dependencyManagement>
Expand Down
6 changes: 6 additions & 0 deletions src/it/projects/external-parent/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ assert 1 == flattendProject.dependencies.size()
assert 1 == flattendProject.dependencies.dependency.size()
assert '4.0.5.RELEASE' == flattendProject.dependencies.dependency[0].version.text()

assert 1 == flattendProject.profiles.size()
assert 1 == flattendProject.profiles.profile.size()
assert 'test' == flattendProject.profiles.profile.id.text()
assert 1 == flattendProject.profiles.profile.dependencies.size()
assert 1 == flattendProject.profiles.profile.dependencies.dependency.size()
assert '1.1.0.RELEASE' == flattendProject.profiles.profile.dependencies.dependency.version.text()
25 changes: 25 additions & 0 deletions src/it/projects/fat-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,38 @@
<!-- https://github.com/mojohaus/flatten-maven-plugin/issues/47 -->
<artifactId>fatjar-dependency-remove</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>parent-depMngt</artifactId>
<version>2</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep1</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>test</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id> test2 </id>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<build>
<defaultGoal>verify</defaultGoal>
<plugins>
Expand Down
8 changes: 8 additions & 0 deletions src/it/projects/fat-jar/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ assert flattendPom.exists()

def flattendProject = new XmlSlurper().parse( flattendPom )
assert 0 == flattendProject.dependencies.size()
assert 0 == flattendProject.dependencyManagement.size()
assert 1 == flattendProject.profiles.size()
assert 1 == flattendProject.profiles.profile.size()
assert 'test2' == flattendProject.profiles.profile.id.text()
assert 1 == flattendProject.profiles.profile.dependencies.size()
assert 1 == flattendProject.profiles.profile.dependencies.dependency.size()
assert 'dep' == flattendProject.profiles.profile.dependencies.dependency.artifactId.text()
assert '1.1' == flattendProject.profiles.profile.dependencies.dependency.version.text()
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>flatten-dependency-all-depmgnt-optional-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>core</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>dep</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>

</project>
33 changes: 33 additions & 0 deletions src/it/projects/flatten-dependency-all-depmgnt-optional/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>flatten-dependency-all-depmgnt-optional</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>flatten-dependency-all-depmgnt-optional-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>

<build>
<defaultGoal>verify</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<configuration>
<flattenDependencyMode>all</flattenDependencyMode>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo.flatten.its</groupId>
<artifactId>core</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
File originalPom = new File( basedir, 'pom.xml' )
assert originalPom.exists()

def originalProject = new XmlSlurper().parse( originalPom )
assert 1 == originalProject.dependencies.size()
assert "core" == originalProject.dependencies.dependency.artifactId.text()
assert "true" == originalProject.dependencies.dependency.optional.text()

File flattenedPom = new File( basedir, '.flattened-pom.xml' )
assert flattenedPom.exists()

def flattenedProject = new XmlSlurper().parse( flattenedPom )
assert 0 == flattenedProject.dependencies.dependency.size()

Loading