> The problem I have now is, that I don't know how to run my application
> once it is built with, say 'mvn package'. I tried 'java -jar

People generally use the assembly plugin for this purpose.
http://maven.apache.org/plugins/maven-assembly-plugin/

> my.package.MainClass', but then it doesn't find any resources I try to
> load in my code with
> "this.getClass().getClassLoader().getResource(...)". All resources are

John Casey sent this method a while ago that might be useful:

private File getFile( String resourceName )
{
 ClassLoader cloader = Thread.currentThread().getContextClassLoader();
 URL resource = cloader.getResource( resourceName );
 if ( resource == null )
 {
     throw new IllegalArgumentException( "Could not get resource: " +
resourceName );
 }
 return new File( resource.getPath() );
}

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to