maven

Nexus repository manager with LDAP users

I wanted to use LDAP to give access to the nexus repository manager from sonatype for those users who need more access than just browsing.

Using maven-exec-plugin to store the current git sha in a build

The current version of the maven buildnumber plugin does not yet support the git scm backend. This makes it harder to get the git sha for the current build (often a snapshot build) into the MANIFEST.MF file.

Let's look at using the exec plugin as a workaround.

Importing Groovy/GMaven/maven projects to Intellij IDEA

When importing a maven pom that uses the gmaven plugins - remember to go into project structure settings and set src/main/groovy as sources and src/test/groovy as test sources.

I'd also like to know why on import of a project that has had mvn install run on it causes Idea to have issues about generated source mismatch etc - mvn clean then a rebuild in Idea will fix this but I can't pin down what is not right.

Using continuum to build maven 2 projects that are in mercurial

Given that the pom has a correctly configured scm tag section then it's just a case of finding the browsable file.

Normally mercurial repo's are exposed using hgweb.cgi or hgwebdir.cgi.

Not sure about hgweb - use hgwebdir myself - but - the trick is to grab the raw file version of the tip revision. Once continuum can grab this then it will use the scm tags to get the project.

https://server/hgwebdircontext/project/raw-file/tip/pom.xml

NOTE

When you run hg clone to grab the repository it will always check out the entire repository.

Using maven2 scm and release plugins with mercurial/hg

Mercurial - like some other distributed version control systems works such that each developer has a full value repository - there is no real master other than by convention in a team.

To set up your maven project so that the scm configuration points to a developers local repo:

    <scm>
        <connection>scm:hg:file://${basedir}</connection>
        <developerConnection>scm:hg:file://${basedir}</developerConnection>
    </scm>

Spring, Aspects, @Configurable and Compile Time Weaving using maven

Why do most people use Load Time Weaving (LTW)? It requires replacing the javaagent/classloader of your JVM which can lead to all sorts of issues.

Let's take a look at getting Compile Time Weaving (CTW) instead.

This post is using spring 2.5.2, aspectj 1.5.4, java 1.5. (Spring 2.5.4 uses a later version of weaver (3.0 vs. 5.0) - I assume AspectJ 1.6.0 but the aspectj-maven-plugin is also based around 1.5.4 - so for now we'll stick with this combination.)


Deploying jars to third party maven repository via WebDAV

Technical:

Normally you deploy to a third party repository with a command similar to:

mvn deploy:deploy-file -Dfile=/path/to/file -DrepositoryId=repositoryId
-Durl=wagon:protocol://path/to/repo -DgroupId=groupId -DartifactId=artifactId
-Dversion=version -Dpackaging=packageType

But - to deploy via webdav needs a snapshot wagon.

To do this - create a temporary pom in the directory you are in (create a scratch dir or similar). This should contain:

Adding self-signed https certificates to java keystore

There are several reasons you may need to add a self-signed https ssl certificate to your local java keystore.

For me - its so that maven can access DAV shares for repository deployment.

spring-ldap and NoClassDefFoundError com.sun.jndi.ldap.ctl.ResponseControlFactory

When using spring-ldap - if you get a NoClassDefFoundError for com.sun.jndi.ldap.ctl.ResponseControlFactory then you need the ldap booster pack (currently 1.0).

This is available from Sun:

http://java.sun.com/products/jndi/downloads/index.html

Go to the JNDI 1.2.1 page and grab JNDI/LDAP Booster Pack 1.0 (ldapbp-1_0.zip)

Unzip and then install as an artifact:

Spring AOP and maven dependencies (<aop:spring-configured/>)

Or - why does it say my spring context xml is invalid on <aop:spring-configured/>

I've been trying to add the @Configurable to a spring project.

This means that I had to have a <beans> tag that looks like

Subscribe to RSS - maven