Added a new DatabaseChoiceListProvider with ja/fr/en translations
- The new choice list provider is fully configurable: JDBC URL and driver, db name, db table, db column, db username, db password. It allows per-job database configuration only.
- Moreover, a fallback mechanism has been added and allows to read a local file containing choices (one per line) if the connection to the database can't be established (for any reason)
- All Messages*.properties have been updated accordingly
- WARNING: the driver class must be manually added to the classpath (either by putting the right JAR in the WEB-INF\lib folder of Jenkins, or by installing one of the Database plugins, such as https://wiki.jenkins-ci.org/display/JENKINS/MySQL+Database+Plugin)
Additional notes:
- There is no tests. Shame on me :-(
mvn testlaunched locally in the original code base, before any modification, was already failing withTests run: 70, Failures: 0, Errors: 35, Skipped: 0. I didn't take the time to try to fix them.- I had to comment some
@Overrideannotations in order to fix compiling issues. Compiler used in Eclipse: 1.6. - This one could be a showstopper: I had to upgrade the
org.jenkins-ci.plugins:pluginfrom 1.466 to 1.580.1.But because I'm not sure this is the minimal version required, I didn't push thepom.xmlfile - Finally, I had to explicitely use the latest release of the maven-hpi-plugin by adding the following to the
pom.xmlfile:
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.95</version>
</plugin>
</plugins>
</build>
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests
mvn eclipse:eclipse generates build configurations that force to compile with Java 1.5.
That cause compilation errors as annotations (like @Override) are introduced in Java1.6.
Uncheck a checkbox like "project specific configuraion" in Project -> Properties -> Java Compiler and you can compile that without errors.

WARNING: the driver class must be manually added to the classpath (either by putting the right JAR in the WEB-INF\lib folder of Jenkins, or by installing one of the Database plugins, such as https://wiki.jenkins-ci.org/display/JENKINS/MySQL+Database+Plugin)
This can be resolved by integrated with Database plugin. Though there are too few examples, you can integrate that as a following way (just outline):
- add an optional dependency to database-plugin 1.1.
- As 1.1 is the greatest version that works with Jenkins 1.466 targeted by extensible-choice-parameter plugin.
- Of course you can upgrade the target Jenkins version and depends to the latest database plugin, but I don't think we need features of database plugin introduced in 1.2.
- Replace database connaction parameter fields of
DatabaseChoiceList providerwithDatabase. - in config.jelly:
<f:dropdownDescriptorSelector field="database" title="${%Database}" />
#9 demonstrates implementation with database plugin.