我想将它打包在一个可执行的jar中以便分发.我需要一个像main.jar这样的可执行文件,并且所有依赖项都在libs/*.jar中
如何在没有预先包含到依赖库的情况下制作maven可执行jar?
在如何使用Maven创建具有依赖关系的可执行JAR?2010年12月1日10:46安德烈·阿隆森回答了一个注释,但是那个根本不起作用(失败的sadescriptorRef未设置).
我尝试编译maven web项目
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<version>3.0.5-FINAL</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
问题是,当我尝试编译它时,我得到以下错误:
[错误]无法在项目inferx-d2aserver上执行目标:无法解析项目com.inferx的依赖关系:inferx-d2aserver:war:4.0:无法解析以下工件:maven-plugins:maven-cobertura-plugin:plugin :1.3,maven-plugins:maven-findbugs-plugin:plugin:1.3.1,org.springframework.ws:spring-ws:jar:3.0.5.RELEASE:找不到maven-plugins:maven-cobertura-plugin:插件:http : //repository.springsource.com/maven/bundles/release中的1.3 缓存在本地存储库中,直到com.springsource.repository.bundles.release的更新间隔已经过去或更新时才会重新尝试解析强制 - > [帮助1] [错误]
我使用Apache Maven 3.0.3,Java:1.7.0操作系统:Windows 7(64位)
如何使用Java-8流/ lambdas,通过键找到地图列表的平均值?
例:
List<Map<String, Double>> users = Arrays.asList(
new HashMap<String, Double>()
{{
put("weight", 109.0);
put("height", 180.2);
}},
new HashMap<String, Double>()
{{
put("weight", 59.0);
put("height", 186.2);
}}
);
Map<String, Double> statistics =
//<MISSED CODE with lambdas> (?)
System.out.println(statistics);
//{weight=84.0, height=183.1)
Run Code Online (Sandbox Code Playgroud)
有了旧的好的foreachs它很简单,我想知道是否可以用lambdas实现.我需要它的原因是我将使用Apache Spark和Java-8 lambdas将是一个更标准的方法.