From Maven |
From Maven |
Take care
From Maven |
From Maven |
Take care
So, after I have finished reading those threads it was clear that I had to handle this problem by manipulating Continuum's database (Derby). So how am I able to do this when the build-server is on a different machine and I'm not allowed to install any oder software on this machine.
I rememberd the fact that NetBeans had it's cool integrated database-ui, by the way this IDE has also integrated support for Derby-databases, so I tried to connect to my Continuum-database by using NetBeans. First I had to stop Continuum or NetBeans would not allow me to connect to the database. After I had stopped the build-server it finally was possible to connect to the Derby-database over NetBeans. So it was possible to connect with the following connection-string: jdbc:derby :\\server\D$\path\to\derby
But then I had the problem that I didn't know which schema I should use to connect to so I tried out every of it. Another problem was that I couldn't see the tables of the database schema so I had to guess the name of the table. In one of the threads there was a sample select-statement but this was only to change the role of an user.From Maven
So after a while of studiing those threads I found a log-file and saw that Continuum creates all tables on start up and in this log-output I found some tables and one of it was the PROJECT-table and after a 'select * from SA.PROJECT' I saw all installed projects. A second table was the BUILDRESULT-table. The last entry in this table was the project which caused the problem. So I decided to delete this entry.From Maven
After restarting Continuum the project wasn't building anymore and then I invoked a 'Build All' and today everything was fine. There is one thing I'd like to mention, in one of a thread that I didn't post was a suggestions to invoke a 'Build All' as solution to stop a project but an answer to this post was that this doesn't work so I'm not sure if my decision to delete the entry from the table was the right solution or the that I invoked the 'Build All'-command over the web-interface of Continuum.
But everything works fine now and maybe this may help you or will give you some ideas if you also run in such kind of problems with the Continuum build-server.
Cheers
Reference-Project Bookstore
My plan is to develop an online bookstore just to show how maven works with a small web-app which consists of some submodules. In this first post I'd like to show only the build-configuration settings for this web-app. First I created a file structure where to store all my tools, projects and their settings. I created the following folders:
The following picture shows the file-structure. I haven't collapse all folders because those are just some configuration-specific folders of the tools.
From Maven |
All folders marked green are ander Subversion source-control. After I created this structure I had to create a subversion-repository. You just have to invoke the command 'svnadmin create path/to/your/custom/folder' and then import your structure with 'svn import /path/to/repo/ -m "some message"'. Then you have to checkout the project for the first time with 'svn checkout /path/to/repo'.
If everything works fine you can now set up you Continuum build-server to interact with your subversion-repo. This server will execute a specific maven commands (which you will be able to configure) to a certain time (cron job syntax) so you always will haven an overview of the checked in sources and if the application is clean.
There is one custom configuration you have to do if you would like to use the file-protocoll when you would like to set the path to your project's pom-file. By default the file-protocoll is turned off but you can turn it on by setting the 'allowedScheme'file'allowedScheme' in the application.xml of continuum which you will find in the CONTINUUM_HOME\apps\continuum\conf folder.
From Maven |
After changing this property everything should work fine. Now you will be able to set up a maven-proxy which enables you to share your application and other artefacts with more developer.
From Maven |
Artifactory is really easy to configure but I'm still a bit confused about some settings. I'm going to write about it in upcoming posts. There is only one thing, if you are behind a proxy you have to configure it in the artifactory.config.xml which you can find in the etc-folder of your Artifactory-installation. The following screenshots show some interesting maven-settings about the scm-Tag (Subversion) and the distributionManagement-Tag which configures the path to the snapshot-repository where you can deploy your snapshot-releases to the Artifactory repositories.
From Maven |
From Maven |
The last thing is to install a webserver where you can deploy your project-site. I have installed Xampp for this kind of purpose. You just have to confiugre your site-tag within your distributionManagement-Tag and then after invoking the mvn site:site site:deploy command your complete project-site will be generated and transfered to your configured path.
So now you have set up a good infrastructure to develop your application and can concentrate on your application logic. In upoming posts I will begin to design my bookstore-application and try to solve the remaining build-configuration-issues.
Of course you're welcome to descripe your best-practices with this kind of technologies and I also would like to mention the fact that this is not a complete description but should give you an idea on how to set up a possible way for a building-environment for a Java-based web-application.
Cheers
From Maven |
From Maven |
Now, back to the actual problem. So, if a developer invokes e.g. a mvn install then Maven checks every artefact if there is a new version somewhere on the web. But what if the developer knows that there aren't any updates and just would like Maven only to use the internal office-proxy. Of course I know the -o (offline-mode) option for Maven but this also will skip the internal proxy. Why should a developer want to skip the external repositories anyway?
If you have a very huge business module which is devided in many, many submodules and e.g. the Maven core-developer do some restructering work on the public repositories at same time as you work, then it's possible that even a simple mvn clean command can take very, very long (~20 min) because the online-checks of Maven are extremly slow. So what can we do something to stop Maven doing this online-update-checks?
My first idea was to configure the maven-proxy (in my case Archivia) also as external repository in the settings.xml. You just have to set the id of one repository to 'central'. Now Maven won't check other external repositories except the configured one.
From Maven |
So if your project needs some artefacts which aren't already in your local or internal proxy repository, the build will fail because Maven doesn't check the public repositories e.g. repo1 or Ibiblio. Here you can see the BUILD FAILURE and the configured remote repositories.
From Maven |
If you would like to receive updates again, just uncomment the 'central' configuration or rename the id to any other name than 'central'. In fact this is the bahaviour I'd like to have. The problem is, that the maven-proxy (Maven-Proxy not Archivia) will still check the remote repositories for updates. I think that's because you can set this configuration in some property file of the Proxy. The following code-snipped is from the Maven 2.0.4 which we use at work:
From Maven |
As you can see, the id 'central' has also been set but Maven still checks the public repositories. *confused* The following picture shows that indeed Maven checks the internal maven-proxy but stills receives data from repo1 or Ibiblio.
From Maven |
I also checked if there isn't the artifact I'd like to receive on any public server by changing the version number of the artefact to an ivalid one. Maven prints out the following set up remote repositories:
From Maven |
So it must be a Mave-Proxy specifig configuration. I don't have a better explanation but I'll keep on researching that problem. Maybe also Archivia will behave like this if I set up remote repositories over the Archivia's web-interface.
But I will write more about my experiences and if I have found a solution in later posts. Maybe there is a simple Maven-setting for this problem which I haven't found yet. You are welcome to post some better solution for this problem.
Cheers