Monday, June 2, 2008

Maven 2 and Apache Archiva

Recently I've started to use Archiva as a Maven 2 repository and I had this unexpected behaviour when using it. First of all I've configured a profile in /home/mpigulski/.m2/settings.xml and added there a repository that was pointing to my Archiva repository. It was working fine, but every time the central repoistory was looked up then my Archiva server was skipped in the path and the whole idea of Archiva as a Maven 2 repository proxy was missed.

I've started digging again and found this configuration option.

After adding this to my settings.xml looked something like this:

<settings>
...
<mirrors>
<mirror>
<id>internal</id>
<name>Internal Mirror of http://repo1.maven.org/maven2/</name>
<url>http://archiva:8001/archiva/repository/internal/</url>
<mirrorof>central</mirrorof>
</mirror>
</mirrors>
...
</settings>


After this, every call to the central repository is overriden by this mirror configuration and every jar downloading is performed very fast.

Tuesday, February 26, 2008

Code highlighting

So first of all I had to have color highlighting on this site. It is impossible to write or publish code without code highlighting. Some quick research led me into google site and after following readme found there I managed to get it working in no time.

Here is a well known code snippet using code highlighting.


package com.blogspot.jcrossroad;

public class HelloWorld {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

Beginning

So it is done. I've created a weblog that I was thinking about for some time now and lets face it, it will be hard to maintain a decent level of content about Java technologies, mainly J2EE and whats the most hard part - to dont forget about to write.

I plan to place here my Java battles reports, about how I managed to get around my problems in everydays work of a programmer in IT software company. It will be my place to store knowledge about things that sometimes need many tricks to accomplish and they are in most cases not described as good as they should in the official reference manuals...

Java technologies that will be involved: MVC Frameworks, Hibernate, IDEs, and others that probably I'm just about to get know of.

I come from Poland, so english is not really my native language and I thought that writing in Polish is not so beneficial to the Java community as it would be in English, nevertheless I'll try to do my best.