首页 文章

Ivy解决了Oracle JDBC依赖关系,但没有将jar与其他依赖关系一起部署

提问于
浏览
0

希望有人可以解决我一直在努力解决的问题 . 我正在将一个小项目从GWT更改为Vaadin,我的所有库都在工作,除了Oracle JDBC驱动程序(ojdbc6.jar) . 阅读后我发现这个库不能通过公共Maven回购获得,所以我开始尝试从我的本地文件系统添加到Ivy .

这是问题所在 . 我已经能够让Ivy解决依赖关系并将其添加到常 Spring 藤缓存中,但它只会将其添加到我的lib / jars文件夹而不是添加到WAR \ WEB-INF \ lib文件夹中 . 我所有其他依赖项似乎都按预期工作并部署到WEB-INF \ lib文件夹,C3P0可以启动数据库池,但在尝试加载JDBC驱动程序时失败 .

我的文件系统设置是ivy-settings.xml中列出的第一个解析器 - 希望有人可以提供帮助!

项目设置

  • Vaadin 7.1.11

  • Eclipse Juno

  • IvyDE 2.2.0final

文件结构

  • C:\dev-vaadin\ivy.repo*
  • ivy6.xml

  • ojdbc6.jar

.ivy2\cache\com.oracle\ojdbc

  • jar

  • ivy-6.xml

  • ivy-6.xml.original

  • ivydata-6.properties

.ivy2\cache\com.oracle\ojdbc\jars

  • ojdbc-6.jar

代码

ivy.xml

1<?xml version="1.0"?>
 2<!DOCTYPE ivy-module [
 3    <!ENTITY vaadin.version "7.1.11">
 4]>
 5<ivy-module version="2.0"
 6    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 7    xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
 8    <info organisation="com.example" module="v7proj" />
 9    <configurations>
10        <!-- The default configuration, which should be deployed to the server -->
11        <conf name="default" />
12        <!-- A configuration only needed when compiling the widget set. Should 
13            not be deployed to the server -->
14        <conf name="widgetset-compile" />
15        <!-- A configuration used in compilation of server side classes only.
16            Should be deployed to the server -->
17        <conf name="nodeploy" />
18    </configurations>
19    <dependencies defaultconf="default" defaultconfmapping="default->default">
20        <!-- The core server part of Vaadin -->
21        <dependency org="com.vaadin" name="vaadin-server" rev="&vaadin.version;" />
22
23        <!-- Vaadin themes -->
24        <dependency org="com.vaadin" name="vaadin-themes" rev="&vaadin.version;" />
25
26        <!-- Push support -->
27        <dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />
28        
29        <!-- log4j -->
30        <dependency org="log4j" name="log4j" rev="1.2.17" conf="default" />
31        
32        <!-- c3p0 -->
33        <dependency org="com.mchange" name="c3p0" rev="0.9.2.1" conf="default" />
34        
35        <!-- Oracle JDBC -->
36        <dependency org="com.oracle" name="ojdbc" rev="6" conf="default" />
37        
38        <!-- simple-java-mail -->
39        <dependency org="org.codemonkey.simplejavamail" name="simple-java-mail" rev="2.1" conf="default" />
40        
41        <!-- GWT -->
42        <dependency org="com.google.gwt" name="gwt-servlet" rev="2.5.1" conf="default" />
43
44        <!-- Apache Commons -->
45        <dependency org="org.apache.commons" name="commons-lang3" rev="3.2.1" conf="default" />
46
47        <!-- Servlet 3.0 API -->
48        <dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" conf="default" />
49
50        <!-- Precompiled DefaultWidgetSet -->
51        <dependency org="com.vaadin" name="vaadin-client-compiled"
52            rev="&vaadin.version;" />
53
54        <!-- Vaadin client side, needed for widget set compilation -->
55        <dependency org="com.vaadin" name="vaadin-client" rev="&vaadin.version;"
56             conf="widgetset-compile->default" />
57
58        <!-- Compiler for custom widget sets. Should not be deployed -->
59        <dependency org="com.vaadin" name="vaadin-client-compiler"
60            rev="&vaadin.version;" conf="widgetset-compile->default" />
61    </dependencies>
62 </ivy-module>

ivy-settings.xml

1<?xml version="1.0" encoding="UTF-8"?>
 2<ivysettings>
 3    <property name="repo.dir" value="C:/dev-vaadin/ivy.repo" />
 4    <settings defaultResolver="default" />
 5    <resolvers>
 6        <chain name="default">
 7            <!-- Localhost filesystem repository -->
 8            <filesystem name="internal">
 9                <ivy pattern="${repo.dir}/ivy[revision].xml" />
10                <artifact pattern="${repo.dir}/[artifact][revision].[ext]" />
11            </filesystem>
12        
13            <!-- Public Maven repository -->
14            <ibiblio name="public" m2compatible="true" />7
15
16            <!-- Vaadin Add-on repository -->
17            <ibiblio name="vaadin-addons" usepoms="true" m2compatible="true"
18                root="http://maven.vaadin.com/vaadin-addons" />
19
20            <!-- Vaadin snapshots repository -->
21            <ibiblio name="vaadin-snapshots" usepoms="true" m2compatible="true"
22                root="https://oss.sonatype.org/content/repositories/vaadin-snapshots" />
23            <!-- Repository used for Vaadin modified smartsprites library -->
24            <dual name="custom-smartsprites">
25                <filesystem name="smartsprites-ivy">
26                    <ivy pattern="${basedir}/ivymodule/[module]-ivy-[revision].xml" />
27                </filesystem>
28                <url name="smartsprites-artifact">
29                    <artifact
30                        pattern="http://dev.vaadin.com/svn/versions/6.8/build/smartsprites/lib/[artifact](-[revision]).[ext]" />
31                </url>
32            </dual>
33        </chain>
34    </resolvers>
35    <modules>
36        <!-- Vaadin patched SmartSprites -->
37        <module organisation="com.carrotsearch" name="smartsprites"
38            revision="0.2.3-itmill" resolver="custom-smartsprites" />
39    </modules>
40
41
42</ivysettings>

1 回答

  • 0

    在eclipse中看看你的项目属性 . 有一个称为“部署程序集”的点,它至少应包含以下两个条目:

    /src          -> WEB-INF/classes
    /WebContent   -> /
    

    然后你可以添加

    /Ivy   -> WEB-INF/lib
    

    确保部署程序集中包含所有需要的库 .

相关问题