用maven将jar加载到项目中

时间:2013-05-16 18:22:20

标签: java google-app-engine maven gwt

我的应用程序需要像这样提供servlet:

serve("_ah/admin/datastore*").with(DatastoreViewerServlet.class); 

但是,此DatastoreViewerServlet位于我的计算机中的运行时sdk中:

some_path/lib/shared/appengine-local-runtime-shared.jar

那么在运行我的应用程序时如何加载这个jar。我正在使用maven,当我运行我的应用程序时,我只是做mvn gwt:run

1 个答案:

答案 0 :(得分:2)

您可以在依赖标记内使用systemPath标记。请尝试以下方法。

<dependency>
  <groupId>com.google.gae</groupId>
  <artifactId>appengine-local-runtime-shared</artifactId>
  <scope>system</scope>
  <systemPath>some_path/lib/shared/appengine-local-runtime-shared.jar</systemPath>
</dependency>