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

[JENKINS-51214] - Allow invoking Custom WAR Packager Maven Plugin in the CLI Mode #26

Merged
merged 4 commits into from May 14, 2018

Conversation

oleg-nenashev
Copy link
Member

@oleg-nenashev oleg-nenashev commented May 9, 2018

Also allows passing installArtifacts which is helpful in this mode

Example:

mvn io.jenkins.tools.custom-war-packager:custom-war-packager-maven-plugin:0.1-alpha-6-SNAPSHOT:build -DconfigFile=essentials.yml

@reviewbybees @raul-arabaolaza

if (batchMode) {
cfg.buildSettings.addMavenOption("--batch-mode");
cfg.buildSettings.addMavenOption("-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird. Delete the option IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it weird?
It may be a bit hackish, but it works if a user does not pass proper settings.xml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the calling script should be responsible for including -B among general Maven options. As to the log option, I consider this a workaround pending JENKINS-51182.

@Parameter(property = "version")
public @CheckForNull String warVersion;

@Parameter(property = "tmpDir")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW if you add Javadoc for these things, and configure your POM to generate HelpMojo, you will make it easier for people to invoke this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oleg-nenashev
Copy link
Member Author

Added the options

@oleg-nenashev oleg-nenashev requested a review from jglick May 11, 2018 08:36
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest deleting batchMode and replacing with a more general option mavenOptions.

@oleg-nenashev
Copy link
Member Author

@jglick It is not a newly introduced thing in this commit, so I would prefer to keep it as is. Anyway, the documentation is pretty explicit that Maven settings is preferable. Later we can introduce the Maven settings option of course

@oleg-nenashev
Copy link
Member Author

Will merge it as is and create a follow-up ticket

@oleg-nenashev oleg-nenashev merged commit 615fb7d into jenkinsci:master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants