如果我使用Dropwizard内核,一些项目不能通过ivy解决:
unresolved dependency: org.glassfish.hk2#hk2-utils;2.16: not found
unresolved dependency: org.glassfish.hk2#hk2-locator;2.16: not found我的常春藤依赖关系是:
<dependency org="io.dropwizard" name="dropwizard-core" rev="0.8.0" />
<dependency org="io.dropwizard" name="dropwizard-jersey" rev="0.8.0" />
<dependency org="org.apache.commons" name="commons-lang3" rev="3.3.2"/>如果我搜索hk-utils或hk2-locator,那么我找不到想要的2.16版本...这是Drowpizard 0.8.0的bug吗?
有人知道如何解决这个问题吗?谢谢。
编辑-正在尝试:
<dependency org="io.dropwizard" name="dropwizard-core" rev="0.8.0">
<exclude org="org.glassfish.hk2" module="hk2-utils" />
<exclude org="org.glassfish.hk2" module="hk2-locator" />
</dependency>
<dependency org="org.glassfish.hk2" name="hk2-utils" rev="2.4.0-b09" />
<dependency org="org.glassfish.hk2" name="hk2-locator" rev="2.4.0-b09" />更新:在Dropwizard 0.8.1中相同更新:似乎在Dropwizard 0.8.4中已解决
发布于 2015-03-10 01:41:23
对我来说很有效...
也许您应该设置一个“默认”配置映射。
<dependency org="io.dropwizard" .... conf="default"/> 示例
以下示例为每个常春藤配置解析依赖项并创建报告。
├── build
│ └── ivy-reports
│ ├── com.myspotontheweb-demo-compile.html
│ ├── com.myspotontheweb-demo-runtime.html
│ ├── com.myspotontheweb-demo-test.html
│ └── ivy-report.css
├── build.xml
└── ivy.xmlivy.xml
<ivy-module version="2.0">
<info organisation="com.myspotontheweb" module="demo"/>
<configurations>
<conf name="compile" description="Required to compile application"/>
<conf name="runtime" description="Additional run-time dependencies" extends="compile"/>
<conf name="test" description="Required for test only" extends="runtime"/>
</configurations>
<dependencies>
<!-- compile dependencies -->
<dependency org="io.dropwizard" name="dropwizard-core" rev="0.8.0" conf="compile->default"/>
<dependency org="io.dropwizard" name="dropwizard-jersey" rev="0.8.0" conf="compile->default"/>
<dependency org="org.apache.commons" name="commons-lang3" rev="3.3.2" conf="compile->default"/>
<!-- runtime dependencies -->
<!-- test dependencies -->
</dependencies>
</ivy-module>build.xml
<project name="demo" default="resolve" xmlns:ivy="antlib:org.apache.ivy.ant">
<available classname="org.apache.ivy.Main" property="ivy.installed"/>
<target name="install-ivy" description="Install ivy" unless="ivy.installed">
<mkdir dir="${user.home}/.ant/lib"/>
<get dest="${user.home}/.ant/lib/ivy.jar" src="http://search.maven.org/remotecontent?filepath=org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar"/>
<fail message="Ivy has been installed. Run the build again"/>
</target>
<target name="resolve" depends="install-ivy" description="Use ivy to resolve classpaths">
<ivy:resolve/>
<ivy:report todir='build/ivy-reports' graph='false' xml='false'/>
<ivy:cachepath pathid="compile.path" conf="compile"/>
<ivy:cachepath pathid="test.path" conf="test"/>
</target>
<target name="clean" description="Cleanup build files">
<delete dir="build"/>
</target>
<target name="clean-all" depends="clean" description="Additionally purge ivy cache">
<ivy:cleancache/>
</target>
</project>备注:
https://stackoverflow.com/questions/28944402
复制相似问题