Skip to content

Commit

Permalink
Wagon Transport Extensions Failed
Browse files Browse the repository at this point in the history
* Force all repositories to be referenced in the pom by id. Alternate syntax is causing issues with wagon transports and imposes an unnecessary code maintenance burden.
* Updated Documentation
    * ForkMode to forkCount.
    * Update examples for repositories
* Cleanup Maven Dependencies to exclude things pulled in and exposed by maven-core
* Cleaned up how remote repositories are created and resolved, so that we're always letting maven create the repository during the session creation.
    * MavenRepositorySession from the 'bridge' package is not exposed.
    * Repositories that come in as part of the pom / settings and are bootstrapped by plexus/maven get mirror, proxy, and authentication injection magically.
    * Constructing our own repositories doesn't get all that, and is overly complex and problematic.
    * Fixes Wagon Transport extensions added as plugin dependencies.
* Bumped to JDK 1.8
  • Loading branch information
bvarner committed Dec 20, 2019
1 parent 68defee commit 9e1dae1
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 183 deletions.
47 changes: 30 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,7 @@ All of the solutions to these issues are implemented independently in different
<version>${gitflow.helper.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<!--
These repository definitions expect either a configured repository id, or an inline definition
like 'id::layout::url::unique'
For example:
release::default::https://some.server.path/content/repositories/test-releases::false
-->
<!-- Tell the plugins what repositories to use (by id) -->
<releaseDeploymentRepository>localnexus-releases</releaseDeploymentRepository>
<stageDeploymentRepository>localnexus-stage</stageDeploymentRepository>
<snapshotDeploymentRepository>localnexus-snapshots</snapshotDeploymentRepository>
Expand Down Expand Up @@ -207,38 +200,58 @@ plugins in the build process (deploy, site-deploy, etc.) will use the repositori

**The repository properties should follow the following format**, `id::layout::url::uniqueVersion`.

When using this plugin, the `<distributionManagement>` repository definitions can be completely removed from your pom.xml
The following configuration block:
When using this plugin, the `<distributionManagement>` repository definitions should be removed from your pom.xml
This block, is replaced by defining 'normal' repositories which are then referenced by the `<id>` and used by the gitflow-helper-maven-plugin to retarget artifact repository deployment and resolution.

<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<layout>default</layout>
<url>https://some.server.path/content/repositories/snapshots</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
<repository>
<id>releases</id>
<layout>default</layout>
<url>https://some.server.path/content/repositories/releases</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>
Can be replaced with the following plugin configuration, which also introduces the stage repository.
Keep in mind repositories can be defined in a user settings.xml as part of your development profiles to keep from repeating yourself in project files.
Below is an example configuration for the gitflow-helper-maven-plugin.

<project...>
...
<repositories>
<repository>
<id>snapshots</id>
<url>https://some.server.path/content/repositories/snapshots</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>false</enabled></releases>
</repository>
<repository>
<id>test-releases</id>
<url>https://some.server.path/content/repositories/test-releases</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
<repository>
<id>releases</id>
<url>https://some.server.path/content/repositories/releases</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
...
<build>
<plugins>
<plugin>
<groupId>com.e-gineering</groupId>
<artifactId>gitflow-helper-maven-plugin</artifactId>
<version>${gitflow.helper.plugin.version}</version>
<configuration>
<releaseDeploymentRepository>releases::default::https://some.server.path/content/repositories/releases::false</releaseDeploymentRepository>
<stageDeploymentRepository>stage::default::https://some.server.path/content/repositories/stage::false</stageDeploymentRepository>
<snapshotDeploymentRepository>snapshots::default::https://some.server.path/content/repositories/snapshots::true</snapshotDeploymentRepository>
<releaseDeploymentRepository>releases</releaseDeploymentRepository>
<stageDeploymentRepository>stage</stageDeploymentRepository>
<snapshotDeploymentRepository>snapshots</snapshotDeploymentRepository>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -405,7 +418,7 @@ You can then connect a remote debugger and step through the plugin code.
## Building with IntelliJ IDEA notes
### To Debug Test Code:
Configure the Maven commandline to include
`-DforkMode=never` You will likely get warnings when you run maven with this argument.
`-DforkCount=0`

### To inspect code-coverage results from Integration Tests:
* Select the **Analyze** -> **Show Coverage Data** menu.
Expand Down
18 changes: 1 addition & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-api</artifactId>
Expand All @@ -106,12 +95,6 @@
<version>3.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>1.3.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -256,6 +239,7 @@
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<version>${project.version}</version>
<pomFile>${pom.basedir}/pom.xml</pomFile>
<file>${project.build.directory}${file.separator}${project.build.finalName}.jar</file>
</configuration>
Expand Down

0 comments on commit 9e1dae1

Please sign in to comment.