Skip to content

Tag: maven-2

How to upload sources to local Maven repository

Suppose I have a Maven 2 Java project on my local machine. I build the project .jar file and push it to my local Maven repo, using mvn install. Question: How can I force Maven to also push the project sources jar to the local repo? This is useful if I’ll use the above mentioned project as dependency whi…

HowTo Unit Test Client Server Code

I’m currently writing a Java Client Server Application. So i want to implement two Libraries, one for the Client and one for the Server. The Client Server Communication has a very strict protocol, that I wan’t to test with JUnit. As build tool im using Maven and a Husdon Server for continues Integ…

“unable to locate Spring NamespaceHandler” error

I’m creating a stand-alone Sava application with Spring, to handle the JDBC access. The application works fine on every test and I decided that I need a jar to be deployed our clients. They might not have spring in their classpath, so I used maven-assembly-plugin to handle the jar creation with dependen…

Get Maven artifact version at runtime

I have noticed that in a Maven artifact’s JAR, the project.version attribute is included in two files: Is there a recommended way to read this version at runtime? Answer You should not need to access Maven-specific files to get the version information of any given library/class. You can simply use getCl…