Comments (4)
From what kind of Java API ? And why? The plugins use the maven-plugin-api and the attributes are injected ?
from build-helper-maven-plugin.
I'm writing a Jenkins plugin for work to release a set projects. Part of the release process is to remove SNAPSHOT & increment to the next version. I could write this myself but I'd rather reuse your functionality.
I could make an external process call but that gets a bit messy.
I'm current using
FieldUtils.writeField(this, "project", project.getMvnProject(), true); FieldUtils.writeField(this, "versionString", project.getMvnProject().getVersion(), true);
but that's not maintainable really.
from build-helper-maven-plugin.
You know things like this:
mvn build-helper:parse-version versions:set \
-DnewVersion=\${parsedVersion.nextMajorVersion}.0.0 \
versions:commit
which can be done in a pipeline very easy? Another option would be to use maven-release-plugin ?
Furthermore if you have a dependency on the build-helper-maven-plugin you would get a large number of dependencies (transitively) which you don't need nor you like to have them in a Jenkins plugin...
Another hint: If you like to reuse code you can use the DefaultVersioning
class which is really doing the parsing of the versions...The code in the plugin looks like this:
DefaultVersioning artifactVersion = new DefaultVersioning( version );
By using artifactVersion
you can now access the major, minor and patch version via:
int major = artifactVersion.getMajor();
int minor = artifactVersion.getMinor();
...
And you don't need to access ParseVersionMojo which will not work in the environment of a Jenkins plugin cause there many things which are injected by Maven which will not working in Jenkins plugins...
from build-helper-maven-plugin.
Well I do have it working in Jenkins :) Doesn't matter in the end as I need to walk the project tree anyways and this won't help, using the code I had before.
from build-helper-maven-plugin.
Related Issues (20)
- The IT addSource does not define the plugin
- add-resource for prepare-package phase doesn't add to jar HOT 1
- Allow one to specify majorVersion and minorVersion when using released-version mojo
- Allow port ranges on reserve-network-port mojo
- released-version does not detect version if maven repository is not configured to look for snapshot
- The plugin does not execute with command line "mvn compile" as in the Maven Handbook. HOT 4
- Use `bsh-property` property for profile activation HOT 5
- Plugin does not honour the skip directive HOT 2
- timestamp-property setting pattern has no effect HOT 1
- Using parse-version with effective-pom generates invalid XML, adds <?xml...?> tag twice
- [RFE] attach-artifact: Add a ignoreIfMissing property to Artifact
- Quiet option for `regex-property` goal. HOT 2
- Please provide a `<skip>` option for each goal. HOT 1
- Feature request: Add version limits to released-version goal
- `regex-property` goal doesn't interpret `<replacement>` correctly, corrupting output
- Request: Capability to use goal "add-source" from the command line
- Option to override nextIncrementalVersion
- Fails the build when running using Maven 3.9.0 HOT 18
- Wrong encoding of pom file in maven central HOT 4
- Plugin should declare these Maven artifacts in `provided` scope HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from build-helper-maven-plugin.