I am finding any maven plugin for versioning database changes.
There are a few plugins that offer some support for this task:
Maven LiquiBase Plugin
Maven Database Migration Plugin
DbMaintain Maven Plugin (a plugin for DbMaintain, the famous tool from Unitils)
I don't have much experience with them, we currently use a custom tool to apply our change scripts. But the Maven Database Migration Plugin is a serious candidate to replace it. LiquiBase is pretty famous but also different, changes are described in a generic XML format. About DbMaintain, it works well (in Unitils) but I've never tested the wrapper plugin mentioned above.
Here is one more, it's simple to use and has excellent support for Mysql stored procedures:
Flyway Maven Plugin
I used this one http://jsoftware.org/maven-dbpatch-plugin
It supports rollback patches too.
Related
I am hoping you might be able to help me with an issue that I can not manage to find a solution for. I want to build an IntelliJ Plugin that is able to connect to a mysql database. However, adding the mysql connector jar as a library like you would for a simple project does not seem to work and I am out of ways to try it to work. Do you have any suggestions I might try? I thought about the plugin.xml dependencies but I can not seem to find a way to specify the dependency properly. Any hint would be much appreciated.
Here is what I have tried:
In a plugin project, I added the mysql connector as dependency:
dependency setup
I have a DB connection class:
connection class
And another class where I've added my main method and I want to execute an SQL query:
execution result
As seen, I am getting a ClassNotFound exception for the Driver.
If I do the exact same setup, but on a simple Java project, the connection runs with no issues. See below:
dependency setup
result
There is a warning about the deprecated explicit loading of the Diver but this is not the issue. Even iv I remove this, the plugin project still can not find the class.
Actually it seems like the recommended way of declaring dependencies for the Plugins is via Gradle dependencies.
Comment by Jakub here https://www.youtube.com/watch?v=-6D5-xEaYig&lc=UgzA2TPtX_1H2PaL7Q54AaABAg.9Mv96dstxEG9N20UT7YuRQ
I looked up how to declare mysql as gradle dependency and found this: https://www.reddit.com/r/gradle/comments/apme5g/how_to_add_mysqlconnector_to_gradle_build/
So I used
dependencies {
implementation ("mysql:mysql-connector-java:8.0.24")
}
in build.gradle and all works fine now :)
Hope this will help others as well.
How to integrated JIRA with Mercurial:
Fisheye - not possible for this task
Mercurial plugin not worked o the JIRA 6.1.7
FishEye supports Mercurial, so perhaps there is some other restriction?
File a support ticket about #2 since it is marked as supported. However, as the original author I recommend using FishEye instead of the plugin as a better solution architecturally
I have written a custom PMD rule specific to my project requirements that is working fine with sonar in standalone mode (following the steps given in this link). I need to integrate the same to hudson.
How can I integrate the custom PMD-sonar rule to Hudson, what is the best way to do so ? Do I need to make changes to the sonar-hudson plugin ?
I got the way out myself. It seems there is no extra configuration required for hudson as the configuration manager itself takes only the url to sonar. Standalone PMD custom rule with sonar integration is sufficient.
I was wondering which steps are the best to upgrade hudson and the plugins.
I'm running 1.347 at the moment. I once tried to update which resulted into a mess because some plugins were incompatible.
Also i want to delete some plugins is it appropriate to just delete the hpi file? It would be nice to know how other people do this step and in which order.
Should i first upgrade hudson and then plugin by plugin?
And if a plugin breaks something downgrade it again? It seems to be a lot of work.
Or is there any easy way?
Also is it enough to save all the xml configuration files in case something breaks that i can recover?
Thanks in advance.
My solution is overkill, but I was burned twice (once by a Hudson bug and once by plugin incompatibilities) and learned my lesson.
I have Hudson installed on a VM with the same plugins as my production instance and a couple of simple builds. When I feel it's time to upgrade, or want to check out the latest release, I upgrade Hudson on the VM and verify that it starts up and can do builds. I only upgrade the production system that all of our developers use after I've upgraded my test system. I generally don't do exhaustive tests on my test system; it's enough to make sure the combination of upgraded Hudson and plugins starts up properly.
When upgrading either the VM or the main system, I upgrade all the plugins, then upgrade Hudson itself and restart. (Since I have a test system, I'm not particularly worried about doing things step by step.)
I came up with my process before Hudson introduced downgrade support. I still use this process because it's important to me to have confidence that an upgrade is not going to break the system that other developers use. This setup also allows me to have an experimental setup that's separate from the main Hudson system, which I find useful.
I usually update Hudson first, then the plugins.
The recent versions of Hudson have some support for this process:
the Hudson 1.376 added downgrade support for the core and plugins.
That means after upgrading a plugin, you have a button which allows you to downgrade to the previous installed version if needed.
the Hudson 1.369 Avoid error with invalid or null primary view, such as in upgrade from older Hudson
And the upcoming Hudson 1.387 will avoid littering HUDSON_HOME with atomic *.xml files, which should make the backup process of critical config files that much easier.
(Currently, with an Hudson 1.386, I see under HUDSON_HOME:
com.mtvi.plateng.hudson.ldap.LdapMailAddressResolver.xml
config.xml hudson.scm.SubversionSCM.xml
de.fspengler.hudson.pview.PViewProjectProperty.xml hudson.tasks.Ant.xml
hudson.maven.MavenModuleSet.xml hudson.tasks.Mailer.xml
hudson.model.UpdateCenter.xml hudson.tasks.Maven.xml
hudson.plugins.clearcase.ClearCaseInstallation.xml hudson.tasks.Shell.xml
hudson.plugins.clearcase.ClearCaseSCM.xml hudson.triggers.SCMTrigger.xml
hudson.plugins.git.GitTool.xml nodeMonitors.xml
hudson.plugins.sonar.SonarPublisher.xml proxy.xml
hudson.scm.CVSSCM.xml
)
It is possible to take the source code directly from a svn repository and analyze it with sonar? Or configure sonar just to run a Checkstyle or pmd plugin for certain sources?
I need to do this on non-maven projects.
Sonar can run without maven entirely. Now there's sonar-runner
Yes, you just need to write a maven or ant script to check out the latest from SVN first, then run the sonar:sonar command.
It looks like Sonar forces you to create a pom.xml file and install maven2, even for a non-mavenized project: http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code
(fyi - Sonar is dead easy with a mavenized project, but in any setup the key will be in getting in the habit of looking at and using the results of Sonar to improve development. That's the hard part.)