Allow use of settings.xml for credentials. #27

Closed
wants to merge 15 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

smoyer64 commented Nov 20, 2012

As noted in issue #25, adding an id element to the configuration section of this plugin and a bit of logic to find the associated username and password in the settings.xml file eliminates the need to put the credentials in the pom.xml file (or to enter them when prompted by the CLI).

This change set includes that functionality along with mojo tests to verify that the username and password are pulled from the correct locations.

smoyer64 added some commits Nov 20, 2012

@smoyer64 smoyer64 Stubbed out logic to load the username and password from the settings
file if an <id> element is provided and username and password are both
null.
9b7aaf9
@smoyer64 smoyer64 Added code to get the username and password from the settings.xml file
if an id is provided (with null username and password values).
0d1ec05
@smoyer64 smoyer64 Added libraries required to process the contents of the settings file as
well as the libraries used to test maven plug-ins.
75d0401
@smoyer64 smoyer64 Copied a stubbed out example pom.xml and settings.xml file into the
project.
5ce7f07
@smoyer64 smoyer64 Stubbed out a base TestCase with some helper methods and added an empty
test class for the AbstractServerConnection (Mojo).
a12a700
@smoyer64 smoyer64 Eliminated HTTP imports that weren't provided by Maven dependencies (or
needed by the plug-in)
0c33375
@smoyer64 smoyer64 Fixed the annotation on the new settings parameter. d028989
@smoyer64 smoyer64 Cleaned up the utility methods and added comments. 61d8eef
@smoyer64 smoyer64 Added the rest of the pom.xml files and settings.xml file needed to test
how credentials are acquired by the plugin.
6013cf1
@smoyer64 smoyer64 Added the rest of the settings.xml and pom.xml files needed to
completely test the plugin's acquisition of credentials.
ebe47be
@smoyer64 smoyer64 Added Mockito to the test dependencies so that the plugin's log could be
mocked and analyzed.
6cf9a6b
@smoyer64 smoyer64 Completed the logic that determines how credentials are acquired by the
plugin.
8904017
@smoyer64 smoyer64 Finished writing tests for the 6 usable permutations of how credentials
can be acquired by the plugin.
77b20d5
@smoyer64 smoyer64 Changed the last few log messages related to the acquisition of
credentials from info to debug level.
6971ccd
Member

jamezp commented Nov 20, 2012

Thank you for this! I'm on holiday for the rest of the week, but I'll give it a review as soon as I can. At a first glance it looks great.

Contributor

smoyer64 commented Nov 20, 2012

There's no hurry as I've built it on our Jenkins and included it from our internal Nexus instance. It's one of those instances where it's better not to break anyone else! In any case, I only modified AbstractServerConnection.java, and added a few dependencies to pom.xml (mostly test scoped). The other files are tests and test resources.

In any case, I'm happy to contribute back to the project as you've saved me a lot of time. I seemed to be stuck between jboss-maven-plugin being behind AS7 and jboss-as-maven-plugin not meeting our security groups requirements (no usernames and passwords can be checked into SCM).

Thanks for all your work ... have a great vacation ... and let me know if you need anything!

Steve

@jamezp jamezp commented on an outdated diff Nov 29, 2012

+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-settings-builder</artifactId>
+ <version>3.0.3</version>
+ <type>jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.9.0</version>
+ <scope>test</scope>
+ </dependency>
@jamezp

jamezp Nov 29, 2012

Member

All the versions should use a property in the version.groupId.artifactId format or something similar to the version properties that are already in the POM.

@jamezp jamezp commented on the diff Jan 28, 2013

...ugin/common/AbstractJbossMavenPluginMojoTestCase.java
@@ -0,0 +1,117 @@
+/*
+ * File: MojoTestUtilities.java
+ * Date: Aug 5, 2011
+ *
+ * Copyright (c) 2011 by Select Systems - All rights reserved.
+ *
+ * By: Select Systems
+ * 111 Heritage Way, Suite S
+ * Boalsburg, PA 16827
+ *
+ * Revision history:
+ *
+ *
+ */
@jamezp

jamezp Jan 28, 2013

Member

I don't mind making the change, but this needs to have the JBoss LGPL license on it. Is that acceptable to you?

@jamezp jamezp commented on the diff Jan 28, 2013

...ss/as/plugin/common/AbstractServerConnectionTest.java
@@ -0,0 +1,180 @@
+/*
+ * File: AbstractServerConnectionTest.java
+ * Date: Nov 19, 2012
+ *
+ * Copyright (c) 2011 by Select Systems - All rights reserved.
+ *
+ * By: Select Systems
+ * 111 Heritage Way, Suite S
+ * Boalsburg, PA 16827
+ *
+ * Revision history:
+ *
+ *
+ */
@jamezp

jamezp Jan 28, 2013

Member

Same commit as above.

Contributor

smoyer64 commented Jan 29, 2013

Yes ... that can be relicensed and assigned as needed. Sorry I didn't catch that (I copied those classes from another plugin I've been working on). Do you need me to make these changes?

Member

jamezp commented Jan 29, 2013

Nah, I'll go ahead an make them. I'll consider this your consent to change it :-)

Contributor

smoyer64 commented Jan 29, 2013

Perfect ... and thanks again!

Member

jamezp commented Jan 29, 2013

Thank you very much @smoyer64 for the patch! Squashed commits and merged.

jamezp closed this Jan 29, 2013

Member

jamezp commented Feb 11, 2013

I realize this is old and already merged, but I forgot to ask the licensing question.

We require that all contributions be made under the terms of the MIT License, http://www.opensource.org/licenses/mit-license.php. Do you agree to the these terms?

Member

jamezp commented Feb 19, 2013

Just a ping on this as I'd like to get a release out this week. Note if you don't agree that's fine too, but I won't be able to use this awesome commit :-)

Contributor

smoyer64 commented Feb 19, 2013

I don't have a problem with that either ... and since I already assigned copyright, I don't think I can tell you no ;) Sorry for the delay but we had an unmovable dead-line and I had to stay focused on that project. Is there any functionality you'd like added to the plugin? Or do you have issues in Jira you'd like me to help with ... I can spend some of my time here at work helping OSS projects (easy for those that we use).

Thanks again!

Steve

Member

jamezp commented Feb 19, 2013

No problem on the delay at all. Totally understand the deadline issue :-) Not that I can think of ATM, but if I do I'll let you know for sure. I mainly want this release to be more of a bug release and adding some features. I want 7.5.Final (after this release) to add more functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment