You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by hockey_dave <da...@yahoo.com> on 2008/11/10 22:03:17 UTC

RepositoryRuntime path

Fairly new to maven.  Developed code using Eclipse and maven on windows.
Trying to deploy to Linux.  How do I get the maven repository into my java
application runtime path.  This is a straight java application with a main()
not running under an app server.
-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1482230.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by hockey_dave <da...@yahoo.com>.
yes exactly.  I have like 70 open source jar files that I'm using and I don't want to specify each of them.  

Maven gives a very elegeant way to reduce compile time complexities in eclipse.  I assume that there must be some way to replicate that in runtime.




________________________________
From: Wayne Fay (via Nabble) <ml...@n2.nabble.com>
To: hockey_dave <da...@yahoo.com>
Sent: Monday, November 10, 2008 4:40:59 PM
Subject: Re: RepositoryRuntime path

> Fairly new to maven.  Developed code using Eclipse and maven on windows. 
> Trying to deploy to Linux.  How do I get the maven repository into my java 
> application runtime path.  This is a straight java application with a main() 
> not running under an app server. 

Can you be a little bit more specific about what you want/need? It 
sounds like you want the dependencies to be available when you run 
"java app.jar MyApp" without specifying the full classpath for all 
dependencies with "-cp ...", but I'm not sure. Alternatively, you can 
use minijar or assembly plugins to create a jar/zip that contains 
everything your project needs to run. 

You may want to look into the exec plugin as well: 
http://mojo.codehaus.org/exec-maven-plugin/plugin-info.html

Wayne 

--------------------------------------------------------------------- 
To unsubscribe, e-mail: users-unsubscribe@... 
For additional commands, e-mail: users-help@... 



________________________________

This email is a reply to your post @ http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1482379.html
You can reply by email or by visting the link above.



-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1482533.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by hockey_dave <da...@yahoo.com>.
For others not quite as familiar, here is the command (it is case sensitive,
so get the Id's right) to get it to install assuming that you have already
downloaded to the directory that you are in.  Thanks.

$ mvn install:install-file -Dfile=sqljdbc.jar
-DgroupId=com.microsoft.jdbcdriver -DartifactId=sqljdbc -Dversion=1.2
-Dpackaging=jar
-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1483164.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by hockey_dave <da...@yahoo.com>.
Never mind.  I forgot to re-add this back into my pom.xml.  Once I did that
it works.

<dependency>
			<groupId>com.microsoft.jdbcdriver</groupId>
			<artifactId>sqljdbc</artifactId>
			<version>1.2</version>
		</dependency>
-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1484869.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by hockey_dave <da...@yahoo.com>.
Drat, even after doing the install (I think correctly), it cannot find the
driver.

[tweb.file.FolderWatcher.main()] riverManagerConnectionProvider FATAL JDBC
Drive
r class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1483224.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by Wayne Fay <wa...@gmail.com>.
> /10/08 6:56:22 PM EST: Missing artifact
> com.microsoft.jdbcdriver:sqljdbc:jar:1.1:compile

You just need to find the jar and use "mvn install:install-file" to
install it into your local repo cache. Of course, this file will also
need to be distributed with the other files as it seems you cannot
depend on it like you can other artifacts as it is not available in
Central.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by hockey_dave <da...@yahoo.com>.
The mojo plugin is a big help.  I think that it's almost working except that
my project depends upon the com.microsoft.jdbc.sqljdbc.jar file which
doesn't seem to be in the maven repository.  Probably due to license
restrictions although MS seems to be saying that it is okay.
https://forums.microsoft.com/msdn/ShowPost.aspx?PostID=775621&SiteID=1

<dependency>
			<groupId>com.microsoft.jdbcdriver</groupId>
			<artifactId>sqljdbc</artifactId>
			<version>1.1</version>
		</dependency>
/10/08 6:56:22 PM EST: Missing artifact
com.microsoft.jdbcdriver:sqljdbc:jar:1.1:compile

Anyway, is there a way to use the maven runtime classpath (exec:java mojo
plugin works great) along with a separate external classpath?  I tried
setting my environment CLASSPATH, but the mojo seems to ignore it.
Or alternatively can someone help me with the microsoft sqljdbc driver from
maven?
THanks
-- 
View this message in context: http://n2.nabble.com/RepositoryRuntime-path-tp1482230p1483050.html
Sent from the maven users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: RepositoryRuntime path

Posted by Wayne Fay <wa...@gmail.com>.
> Fairly new to maven.  Developed code using Eclipse and maven on windows.
> Trying to deploy to Linux.  How do I get the maven repository into my java
> application runtime path.  This is a straight java application with a main()
> not running under an app server.

Can you be a little bit more specific about what you want/need? It
sounds like you want the dependencies to be available when you run
"java app.jar MyApp" without specifying the full classpath for all
dependencies with "-cp ...", but I'm not sure. Alternatively, you can
use minijar or assembly plugins to create a jar/zip that contains
everything your project needs to run.

You may want to look into the exec plugin as well:
http://mojo.codehaus.org/exec-maven-plugin/plugin-info.html

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org