Sunday 16 March 2008

Looking Through The Eyes of Love - chords

File under extra-cheesy. While doing some mp3 cleanup - for the nth night running - I found that I have two versions of this song. One by Melissa Manchester and the other is a version by Lea Salonga in concert.  

Blame it on my soft rock, love song-saturated childhood, but up to now I still like the song. Love it even, in my moments of supreme senti-ness. So much that I even sang it at karaoke. But only once. And with 4 other people. Way back in the early 90s. In a Chinese restaurant in Ashfield where we seemed to be the only ones who spoke English. (Or so we liked to believe, just to make us feel less guilty at inflicting our singing on them.)

And here are the chords, lifted from another page on the web that automatically plays a karaoke-ish MIDI file when you view it.  Dontcha hate those?

LOOKING THROUGH 
THE EYES OF LOVE
(Theme from Ice Castles)
Melissa Manchester


I
C                                        CM7
Please, don't let this feeling end
                         C7
It's everything I am
                    F                F-Em-Dm
Everything I want to be
         G               Em    Am Am-Em-Dm
I can see what's mine now
             G              Em  Am7
Finding out what's true
         F   E7   Am   Am7-D7
Since I found you
              Dm                         G
Looking through the eyes of love

II
C                            CM7
Now, I can take the time
                    C7
I can see my life
                         F                F-Em-Dm
As it comes up shining now
                G       Em   Am  Am-Em-Dm
Reaching out to touch you
         G        Em    Am7
I can feel so much
         F  E7    Am  Am7-D7
Since I found you
             Dm             G         C
Looking through the eyes of love
Chorus:
        Am     Em    Am
And now, I do believe
         Em          F             G              C
That even in a storm we'll find some light
Dm         Em          F                    G
Knowing you're beside me, I'm all right
III
Please, don't let this feeling end
It might not come again
And I want to remember
How it feels to touch you
How I feel so much
Since I found you
Looking through the eyes of love

Chorus:
Repeat II - Chords two frets higher

Thursday 13 March 2008

Activating root account in OS X to enable sudo

This is the 2nd time I've had to do this and again have ended up
trawling the net for information, so I'll put it here.

If installing ruby gems, you need to do it as root or to do 'sudo gem
install [gem name]'

But you can't sudo if there's no root account!

So....

1. Enable root

In OS X 10.5 - you do it using the Directory Utility application. Log
in on an Admin account, run Directory Utility, and in the Edit menu,
select 'Activate Root account' (or a menu item similarly named). You
then enter the root password and verify.


2. Add your normal account to sudoers file.

Run visudo - a command-line util to edit the sudoers file in
/etc/sudoers, which contains the users or group that are allowed to
su-su-sudio.. er, ahem.. run sudo. :P

Using visudo is better than editing sudoers file directly because it
prevents any changes being saved if there are any incorrect entries.
Incorrect entries are BAD news for sudoers, since it prevents you from
doing sudo, and you have to call sudo to edit it or run visudo!
(chicken or egg!)

Under the section "# User privilege specification" - add a similar
entry with your username, like:

[username] ALL=(ALL) ALL

In this case, the username is the unix user, not the long Mac user
name you see when you log in.


3. Log out of the Admin account, then try doing something with sudo, like

sudo gem install mechanize

to see the results of your handiwork.

Gurus, please send corrections if any of the above is not exactly correct!

Saturday 8 March 2008

Maven settings.xml that uses Artifactory, and restricts snapshot repository use

Hopefully this information is useful for other people who have Maven
projects but have to use other libraries and Maven plugins that are
still in the pre-release stage.

We are using Artifactory at work as a local repository proxy for Maven.

We also have a project that makes use of some snapshot libraries for
the CXF project, which is currently under incubation in Apache.

Previously, we were just using a <mirrors> but this resulted in Maven
getting its metadata settings both from the central repository and the
snapshot locations. We ended up getting snapshots of Maven plugins
that we never really wanted, as Maven would get plugin metadata from
both the repository types, and of course, the latest version would be
the snapshot ones.

To remedy this, we had to change settings.xml so that the only time
the Apache snapshot plugin repositories are used is in the projects
that require the CXF plugin and associated dependencies. The important
thing is to make sure the id element in the repository settings match
the repository setting id in the project pom.xml. The pom.xml settings
can still point to the live, non-proxied repository, but Maven will
first look at the id in that pom file and see if there is an entry
with the same id in the settings.xml

<settings>

<!-- uncomment this section and comment out the profiles section if
the Artifactory (local maven repository) is broken -->

<!--

<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>company.proxy</host>
<port>8080</port>
</proxy>
</proxies>
-->


<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>

<repositories>
<repository>
<id>central</id>
<url>http://internal.company.proxy:7070/artifactory/repo1
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>

<url>http://internal.company.proxy:7070/artifactory/snapshots-only
<releases>
<enabled>false</enabled>
</releases>
</repository>

<repository>
<id>everything-else</id>

<url>http://internal.company.proxy:7070/artifactory/releases
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>

<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<repository>
<id>apache.org</id>

<url>http://internal.company.proxy:7070/artifactory/apache-m2-snapshots
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<repository>
<id>apache.incubating.releases</id>

<url>http://internal.company.proxy:7070/artifactory/apache-m2-incubating
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

</repositories>


<pluginRepositories>

<pluginRepository>
<id>central</id>
<url>http://internal.company.proxy:7070/artifactory/repo1
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>

<url>http://internal.company.proxy:7070/artifactory/snapshots-only
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>

<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<pluginRepository>
<id>apache-plugin-incubating</id>

<url>http://internal.company.proxy:7070/artifactory/apache-m2-incubating
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>


</pluginRepositories>

</profile>

</profiles>

Grownups

I've seen this before but this time it made me feel more warm and fuzzy than before.

Wednesday 5 March 2008

Maven reporting plugins - useful for generated reports in the Maven-generated project site

We're currently setting up CruiseControl at work and are looking to
have more documentation on various aspects of each project. Adding
these settings to a Maven projects pom.xml would generate a lot of
useful information that would cover our needs.


<reporting>
<plugins>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<!--

<plugin>

This plug-in provides functionality for accessing FindBugs
from Maven.

<artifactId>maven-findbugs-plugin</artifactId>
</plugin>

-->


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<!--
The JXR plugin produces a cross-reference of the project's sources.
The generated reports make it easier for the user to
reference or find
specific lines of code. It is also handy when used with
the PMD plugin
for referencing errors found in the code.
for multi-module projects, see:

http://maven.apache.org/plugins/maven-jxr-plugin/examples/aggregate.html

-->
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<!--
The PMD plugin allows you to automatically run the PMD
code analysis tool on your
project's source code and generate a site report with its
results. It also supports
the separate Copy/Paste Detector tool (or CPD) distributed
with PMD.
-->
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<linkXref>true</linkXref>
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<!--
This plugin is used to inform your users of the changes
that have occured
between different releases of your project. The plugin can
extract these changes,
either from a changes.xml file or from the JIRA issue
management system,
and present them as a report.
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>

===================

Updated 6 March 2008: Commented out the Findbugs plugin entry because I can't get it to work yet. The settings above are actually for Maven1. To use the Maven2 plugin it should be like this:


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.1.1</version>
</plugin>




We are using Artifactory, but for some reason I get this Maven error:

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.codehaus.mojo:findbugs-maven-plugin': POM 'org.codehaus.mojo:findbugs-maven-plugin' not found in repository: Unable to download the artifact from any repository

org.codehaus.mojo:findbugs-maven-plugin:pom:1.1.1

from the specified remote repositories:
everything-else (http://192.168.1.1:7070/artifactory/releases),
snapshots (http://192.168.1.1:7070/artifactory/snapshots-only),
central (http://192.168.1.1:7070/artifactory/repo1)


However, when I got to repo1.maven.org (which is in my proxy configs), the Findbugs plugin is there at:

http://repo1.maven.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/

So why is Maven (or Artifactory) unable to retrieve this plugin?

Again, what is going on here?

I guess I should test this first by removing Artifactory from the picture, removing the proxy settings from my settings.xml. If it fails, then it's a Maven issue. If it works, maybe it's Artifactory.

========================

Update:

Removed the Artifactory settings and Maven was able to download the plugin correctly. Maybe I should expire some caches and see if it is able to get the plugin?