Monday, December 1, 2008

Building Shindig 101

"Proxy" problem:


While most of the world in enjoying the freedom of non-proxy Internet some people (like me) are behind a proxy server. Whatever, to get Maven working behind a proxy you need to go to your Maven installation folder and edit the file settings.xml in conf folder. What do you put in there?


<settings>
.
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>proxyhost.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
.
</settings>

Building Shindig - The canonical way:


Building shindig (I assume that you know how to get the code using Subversion) the canonical way is simple:



cd ~/src/shindig/
mvn


This should be enough for most of you but if you are unlucky like me. You may get variety of errors:

1. Too many unapproved licenses: 12


Some people get a different number (even 0 - see this mail trail: http://www.mail-archive.com/shindig-dev@incubator.apache.org/msg07718.html)


2. Test failure :

May be one of the most frustrating thing is the test failures. They are hard to find and resolve sometimes.


So the question is; what are the options that you can try while building Shindig (and if *something* goes wrong - the list is in no particular order):

1. Delete your .m2/repository folder and retry - This will download all the required jar files once more. If you have missed something in the previous go you may get it (due to downtime to some download location). This is important if you get "Missing Artifacts" kind of an error.

2. Try : mvn clean install [ This cleans old bad builds and gives you kind of a fresh start]

3. Checkout or update the code from the Shindig repo once more.

4. Update the code once more if the build fails badly as this can happen due to unintentional commit mishaps.

5. If only the test fails and you are not patient enough to debug, use the following to suppress the error:


mvn -Dmaven.test.failure.ignore=true



6. If you are too brave you can even try:


mvn -Dmaven.test.failure.ignore=true -fn


[This worked for me when I got *too many unapproved licenses : 12*]


all the failures are suppressed by this -fn it will *NEVER* fail the build.



So that's about it while building Shindig. Hope this helps - if you have any other way of doing this let me know.

No comments: