WEB开发网
开发学院软件开发Java ivy教程(8)-使用ivy模块配置 阅读

ivy教程(8)-使用ivy模块配置

 2009-10-08 00:00:00 来源:WEB开发网   
核心提示: 2. 解释如你所见,我们定义了3个公共配置和一个私有配置(为测试定义junit依赖),ivy教程(8)-使用ivy模块配置(2),2个实现配置homemade-impl, cc-impl 继承自api配置,因此在api中定义的制品在它的继承配置中同样是需要的,3. 在实战中检验The libra

2. 解释

如你所见,我们定义了3个公共配置和一个私有配置(为测试定义junit依赖)。

2个实现配置homemade-impl, cc-impl 继承自api配置,因此在api中定义的制品在它的继承配置中同样是需要的。

在publications标签中,我们定义了我们要产生的制品(在这里它们是jar)并给他们使用了配置。

后面当其他模块要使用我们的类库时,他们将有非常灵活的方式来定义他们需要的东西。

3. 在实战中检验

The library project is build using ant. Open a shell in the root directory of the project and type ant.

类库项目使用ant来构建。在项目的根目录下打开一个shell,并输入ant。

Buildfile: src\example\configurations\multi-projects\filter-framework\build.xml
clean:
resolve:
[ivy:retrieve] :: Ivy 2.0.0-beta1-local-20071105200109 - 20071105200109 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] No ivy:settings found for the default reference 'ivy.instance'.  A default instance will be used
[ivy:retrieve] no settings file found, using default...
[ivy:retrieve] :: loading settings :: url = jar:file:/c:/dev/data/opensource_workspace/ivy/build/artifact/ivy-
core.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: [ org.apache | filter-framework | working@BEN-ScokartG ]
[ivy:retrieve]     confs: [api, homemade-impl, cc-impl, test]
[ivy:retrieve]     found [ commons-collections | commons-collections | 3.1 ] in public
[ivy:retrieve]     found [ junit | junit | 3.8 ] in public
[ivy:retrieve] downloading http://repo1.maven.org/maven2/commons-collections/commons-collections/3.1/commons-collections-
3.1.jar ...
[ivy:retrieve] ....................................................................
[ivy:retrieve] ....................................................................
[ivy:retrieve] ...................................
[ivy:retrieve] ....................................................................
[ivy:retrieve] ................................... (546kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]     [SUCCESSFUL ] [ commons-collections | commons-collections | 3.1 ]/commons-collections.jar[jar] (8322ms)
[ivy:retrieve] downloading http://repo1.maven.org/maven2/junit/junit/3.8/junit-3.8.jar ...
[ivy:retrieve] ....................................................................
[ivy:retrieve] ... (118kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]     [SUCCESSFUL ] [ junit | junit | 3.8 ]/junit.jar[jar] (3015ms)
[ivy:retrieve] :: resolution report ::
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |        api       |   0   |   0   |   0   |   0   ||   0   |   0   |
    |   homemade-impl  |   0   |   0   |   0   |   0   ||   0   |   0   |
    |      cc-impl     |   1   |   1   |   0   |   0   ||   1   |   1   |
    |       test       |   2   |   2   |   0   |   0   ||   2   |   2   |
    ---------------------------------------------------------------------
[ivy:retrieve] :: retrieving :: [ org.apache | filter-framework ]
[ivy:retrieve]     confs: [api, homemade-impl, cc-impl, test]
[ivy:retrieve]     3 artifacts copied, 0 already retrieved
build:
    [mkdir] Created dir: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\build
    [mkdir] Created dir: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\distrib
    [javac] Compiling 4 source files to C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-
projects\filter-framework\build
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
      [jar] Building jar: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\distrib\filter-api.jar
      [jar] Building jar: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\distrib\filter-hmimpl.jar
      [jar] Building jar: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\distrib\filter-ccimpl.jar
test:
    [mkdir] Created dir: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\build\test-report
    [mkdir] Created dir: C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-projects\filter-
framework\build\test-classes
    [javac] Compiling 3 source files to C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-
projects\filter-framework\build\test-classes
    [junit] Running filter.ccimpl.CCFilterTest
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0.02 sec
    [junit] Running filter.hmimpl.HMFilterTest
    [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0 sec
publish:
[ivy:publish] :: delivering :: [ org.apache | filter-framework | working@BEN-ScokartG ] :: 1.3 :: release :: Mon Nov 05
21:10:46 CET 2007
[ivy:publish]     delivering ivy file to C:\dev\data\opensource_workspace\ivy\src\example\configurations\multi-
projects\filter-framework\distrib/ivy.xml
[ivy:publish] :: publishing :: [ org.apache | filter-framework ]
[ivy:publish]     published filter-hmimpl to C:\Documents and Settings\scokartg\.ivy2\local/org.apache/filter-
framework/1.3/jars/filter-hmimpl.jar
[ivy:publish]     published filter-api to C:\Documents and Settings\scokartg\.ivy2\local/org.apache/filter-
framework/1.3/jars/filter-api.jar
[ivy:publish]     published filter-ccimpl to C:\Documents and Settings\scokartg\.ivy2\local/org.apache/filter-
framework/1.3/jars/filter-ccimpl.jar
[ivy:publish]     published ivy to C:\Documents and Settings\scokartg\.ivy2\local/org.apache/filter-
framework/1.3/ivys/ivy.xml
     [echo] project filter-framework released with version 1.3
BUILD SUCCESSFUL
Total time: 20 seconds

上一页  1 2 3 4 5 6  下一页

Tags:ivy 教程 使用

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接