2016-04-24 4 views
0

私は現在、apache ivyのconf設定で苦労しています。たぶん、私が最初に達成したいものを を説明します:Ivy conf struggle

  1. 私は2つの設定をしたい:解決さをツタ各設定、推移的依存関係
を含むすべてのjarファイルのために私がしたい、ランタイム
  • をコンパイル

    は、ここに私が試した何か:

    <configurations> 
        <conf name="compile" visibility="public"/> 
        <conf name="runtime" visibility="public" extends="compile"/> 
    </configurations> 
    <dependencies> 
        <dependency org="org.apache.ivy" name="ivy" rev="2.4.0" conf="runtime->runtime, compile->compile"/> 
    </dependencies> 
    

    しかし、それも解析することができません。 ツタファイル「... \ ivy.xml」コ

    confの設定を正しく宣言する方法を教えてください。コンパイルやランタイムのいずれかを使用して解決でき、推移的な依存関係を含むすべてのjarを取得できます(この例では、ivyのjarファイルのみです。 )。

    更新リンク用

    [OK]を、ありがとう。これは少し明確になりますが、私はまだ固執しています。

    それが「デフォルト」のスコープでツタの瓶を解決するように私は、依存関係の宣言を変更:ツタEclipseのプラグインの 解析にバグがあるのだと思われ (私は、「コンパイル>デフォルト」宣言を除外)

    <dependency org="org.apache.ivy" name="ivy" rev="2.4.0" conf="runtime->default"/> 
    

    と設定 confs='*' and types='*'とツタのEclipseプラグインを使用して、ジャー()を取得。

    私はただ一つのivy-2.4.0.jarしか持っていませんでした。私はすべてのランタイム依存性を期待していました。私は(全体のxmlファイルが後に追加される)のようなツタのxmlファイル内の宣言を理解していないと私は正確に、彼らはどの伝えることはできません。

    <dependency org="org.apache.ant" name="ant" rev="1.7.1" force="true" conf="optional->compile(*),master(*)"/> 
    

    は、ここで私はCONF = "runtime-を理解する方法です>デフォルトの」宣言:ツタの依存性が(ローカル)のconf 『ランタイム』に割り当てられている

    • ツタの依存性は、リモートconfに 『デフォルト』
    • iが解決(または取得)するたびに割り当てられている

    • conf 'ランタイム'の依存関係i は、「デフォルト」のconfが

      として宣言されているようlink

    「リモートモジュールのアーティファクトとすべてのそれは、ランタイム推移依存関係だ」、confの「デフォルト」のための推移的依存関係 を含むリモートの依存関係のすべてを取得します

    は、ここに私のivy.xmlです:

    <?xml version="1.0" encoding="ISO-8859-1"?> 
    <ivy-module version="2.0" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"> 
        <info organisation="My Name" module="jaculon.ivy" status="integration"> 
        </info> 
    
        <configurations> 
         <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/> 
         <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/> 
         <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/> 
         <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/> 
         <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/> 
         <conf name="test" visibility="public" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/> 
         <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/> 
         <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/> 
         <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/> 
         <conf name="optional" visibility="public" description="contains all optional dependencies"/> 
        </configurations> 
        <dependencies> 
         <!-- Need ivy to resolve the jars. --> 
         <dependency org="org.apache.ivy" name="ivy" rev="2.4.0" conf="runtime->default"/> 
        </dependencies> 
    
    </ivy-module> 
    

    はここでコンテンツツタ2.4.0.xmlです:

    <?xml version="1.0" encoding="UTF-8"?> 
    <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> 
        <info organisation="org.apache.ivy" 
         module="ivy" 
         revision="2.4.0" 
         status="release" 
         publication="20141222174010" 
        > 
         <description homepage="http://ant.apache.org/ivy/" /> 
         <m:properties__project.build.sourceEncoding>UTF-8</m:properties__project.build.sourceEncoding> 
         <m:properties__organization.logo>http://www.apache.org/images/asf_logo_wide.gif</m:properties__organization.logo> 
         <m:properties__distMgmtSnapshotsName>Apache Development Snapshot Repository</m:properties__distMgmtSnapshotsName> 
         <m:properties__distMgmtSnapshotsUrl>https://repository.apache.org/content/repositories/snapshots</m:properties__distMgmtSnapshotsUrl> 
         <m:maven.plugins>org.apache.maven.plugins__maven-remote-resources-plugin__null|org.apache.maven.plugins__maven-remote-resources-plugin__null</m:maven.plugins> 
         <m:properties__sourceReleaseAssemblyDescriptor>source-release</m:properties__sourceReleaseAssemblyDescriptor> 
        </info> 
        <configurations> 
         <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/> 
         <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/> 
         <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/> 
         <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/> 
         <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/> 
         <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/> 
         <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/> 
         <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/> 
         <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/> 
         <conf name="optional" visibility="public" description="contains all optional dependencies"/> 
        </configurations> 
        <publications> 
         <artifact name="ivy" type="jar" ext="jar" conf="master"/> 
         <artifact name="ivy" type="source" ext="jar" conf="sources" m:classifier="sources"/> 
         <artifact name="ivy" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/> 
        </publications> 
        <dependencies> 
         <dependency org="org.apache.ant" name="ant" rev="1.7.1" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="org.apache.ant" name="ant-nodeps" rev="1.7.1" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="org.apache.ant" name="ant-trax" rev="1.7.1" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="commons-httpclient" name="commons-httpclient" rev="3.0" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="oro" name="oro" rev="2.0.8" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="commons-vfs" name="commons-vfs" rev="1.0" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="com.jcraft" name="jsch" rev="0.1.50" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="com.jcraft" name="jsch.agentproxy" rev="0.0.6" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="com.jcraft" name="jsch.agentproxy.connector-factory" rev="0.0.6" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="com.jcraft" name="jsch.agentproxy.jsch" rev="0.0.6" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="org.bouncycastle" name="bcpg-jdk14" rev="1.45" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="org.bouncycastle" name="bcprov-jdk14" rev="1.45" force="true" conf="optional->compile(*),master(*)"/> 
         <dependency org="junit" name="junit" rev="3.8.2" force="true" conf="test->runtime(*),master(*)"/> 
         <dependency org="commons-lang" name="commons-lang" rev="2.6" force="true" conf="test->runtime(*),master(*)"/> 
         <dependency org="org.apache.ant" name="ant-testutil" rev="1.7.0" force="true" conf="test->runtime(*),master(*)"> 
          <exclude org="*" module="*" name="*" type="*" ext="*" conf="" matcher="exact"/> 
         </dependency> 
         <dependency org="ant" name="ant-launcher" rev="1.6.2" force="true" conf="test->runtime(*),master(*)"> 
          <exclude org="*" module="*" name="*" type="*" ext="*" conf="" matcher="exact"/> 
         </dependency> 
         <dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" force="true" conf="test->runtime(*),master(*)"> 
          <exclude org="*" module="*" name="*" type="*" ext="*" conf="" matcher="exact"/> 
         </dependency> 
         <dependency org="xerces" name="xercesImpl" rev="2.6.2" force="true" conf="test->runtime(*),master(*)"/> 
         <dependency org="xerces" name="xmlParserAPIs" rev="2.6.2" force="true" conf="test->runtime(*),master(*)"/> 
        </dependencies> 
    </ivy-module> 
    
  • +0

    あなたが投稿してくださいでしたあなたのivy.xml全体? – cantSleepNow

    答えて