Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
histream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raphael
histream
Commits
54a4d51b
Commit
54a4d51b
authored
Sep 21, 2016
by
R.W.Majeed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dependency-properties mojo
parent
3b182867
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
histream-maven-plugin/src/main/java/de/sekmi/histream/maven/DependenciesPropertiesMojo.java
...a/de/sekmi/histream/maven/DependenciesPropertiesMojo.java
+48
-0
pom.xml
pom.xml
+1
-1
No files found.
histream-maven-plugin/src/main/java/de/sekmi/histream/maven/DependenciesPropertiesMojo.java
0 → 100644
View file @
54a4d51b
package
de.sekmi.histream.maven
;
import
java.util.Set
;
import
org.apache.maven.artifact.Artifact
;
import
org.apache.maven.plugin.AbstractMojo
;
import
org.apache.maven.plugin.MojoExecutionException
;
import
org.apache.maven.plugins.annotations.LifecyclePhase
;
import
org.apache.maven.plugins.annotations.Mojo
;
import
org.apache.maven.plugins.annotations.Parameter
;
import
org.apache.maven.plugins.annotations.ResolutionScope
;
import
org.apache.maven.project.MavenProject
;
@Mojo
(
name
=
"dependency-properties"
,
requiresDependencyResolution
=
ResolutionScope
.
TEST
,
defaultPhase
=
LifecyclePhase
.
INITIALIZE
,
threadSafe
=
true
)
public
class
DependenciesPropertiesMojo
extends
AbstractMojo
{
/**
* The current Maven project
*/
@Parameter
(
defaultValue
=
"${project}"
,
readonly
=
true
,
required
=
true
)
protected
MavenProject
project
;
/**
* Skip plugin execution completely.
*
* @since 2.7
*/
@Parameter
(
property
=
"mdep.skip"
,
defaultValue
=
"false"
)
private
boolean
skip
;
/**
* Main entry into mojo. Gets the list of dependencies and iterates through setting a property for each artifact.
*
* @throws MojoExecutionException with a message if an error occurs.
*/
public
void
execute
()
throws
MojoExecutionException
{
Set
<
Artifact
>
artifacts
=
project
.
getArtifacts
();
for
(
Artifact
artifact
:
artifacts
)
{
project
.
getProperties
().
setProperty
(
artifact
.
getDependencyConflictId
()+
".version"
,
artifact
.
getVersion
()
);
}
}
}
pom.xml
View file @
54a4d51b
...
...
@@ -52,8 +52,8 @@
</license>
</licenses>
<modules>
<module>
histream-i2b2
</module>
<!--
<module>histream-i2b2</module>
<module>histream-core</module>
<module>histream-hl7</module>
<module>histream-skos</module>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment