Ivy解析Oracle JDBC依赖关系,但不部署jar与其他依赖关系



希望有人能对我一直在处理的问题有所了解。我正在将一个小项目从GWT转换为Vaadin,除了OracleJDBC驱动程序(ojdbc6.jar)之外,我的所有库都在工作。在四处阅读后,我发现这个库无法通过公共Maven repo获得,所以我开始从本地文件系统将它添加到Ivy中。

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

我的文件系统设置是ivy-settings.xml中列出的第一个解析器,希望有人能帮忙!

项目设置

  • Vaadin 7.1.11
  • 日蚀朱诺
  • IvyDE 2.2.0最终

文件结构​

*C:\dev vaadin\ivy.repo*

  • ivy6.xml
  • ojdbc6.jar

.ivy2\cache\com.oracle\ojdbc

  • 罐子\
  • ivy-6.xml
  • ivy-6.xml.原始
  • ivydata-6-属性

.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>

常春藤设置.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>

在eclipse中查看您的项目属性。有一个点叫做"部署组件",它应该至少包含以下两个条目:

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

然后你可以添加

/Ivy   -> WEB-INF/lib

请确保所有需要的库都包含在部署程序集中。

最新更新