Try:

sudo apt-get install maven

如果它对你有用,就忽略这篇文章的其余部分。

介绍

我在2013年4月开始安装我的Ubuntu 12.10,当时正常的sudo apt-get安装maven还不能用于maven 3。

如果你想深入了解你的ubuntu内核,了解apt-get以及它在哪里找到可供安装的应用程序列表,这篇文章中的手动安装是很有用的 . 如果你在Ubuntu 12.10时遇到了和我一样的问题,它也可能对Ubuntu 15.04等最新版本有用。

通过apt-get自动安装:

如果您当前的ubuntu不能通过普通的“apt-get install maven”安装maven,请检查手动安装。

sudo apt-get update
sudo apt-get install maven

如果你的ubuntu不是最新的,或者你以前使用过maven 2,请确保删除maven 2:

sudo apt-get remove maven2

手动安装通过apt-get添加maven 3资源库(Ubuntu 14.04检查更新1):

如果你的ubuntu apt-get存储库列表不是最新的,这是很有用的。

安装系统需要Maven 3,而且大多数文档都是关于如何将Maven安装到Ubuntu 12.04或之前版本的。我找到的最好的文件是:

杀手罗非鱼的博客

我想到的整个过程如下:

sudo -H gedit /etc/apt/sources.list 添加以下行源代码。文件列表: Deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu精密主 Deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu精密主 Sudo apt-get update && Sudo apt-get install maven3 Sudo ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn

警告1:命令“sudo apt-add-repository ppa:natecarlson/maven3”在我的Ubuntu上不起作用,必须运行sudo apt-add-repository -rm ppa:natecarlson/maven3才能让我的apt-get再次工作。 警告2:感谢David,在运行第4步之前,您需要删除到以前版本maven的现有符号链接。

OS X安装

我决定添加OS X安装,以防您为开发人员使用多个环境:请参阅源stackoverflow线程了解更多详细信息。

安装相当于apt-get的Homebrew,然后使用以下命令安装Maven:

brew install maven

更新1:ubuntu 14.04的安装

我自己没有尝试过,但我相信这应该可以在没有安全警告的情况下工作:

sudo apt-get purge maven maven2 maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3

注意:来源在这里,非常感谢@rendybjunior, @Dominic_Bartl和@FunThomas424242

有没有这样做的方法:

$test_array = array(
    "first_key" => "first_value", 
    "second_key" => "second_value"
);

var_dump(
    array_map(
        function($a, $b) {
            return "$a loves $b";
        }, 
        array_keys($test_array), 
        array_values($test_array)
    )
);

但是不是调用array_keys和array_values,而是直接传递$test_array变量?

期望的输出是:

array(2) {
  [0]=>
  string(27) "first_key loves first_value"
  [1]=>
  string(29) "second_key loves second_value"
}

你可以在网上找到以下资料:

Higher kinded type == type constructor? class AClass[T]{...} // For example, class List[T] Some say this is a higher kinded type, because it abstracts over types which would be compliant with the definition. Higher kinded types are types which take other types and construct a new type These though are also known as type constructor. (For example, in Programming in Scala). Higher kinded type == type constructor which takes type constructor as a type parameter? In the paper Generics of a Higher Kind, you can read ... types that abstract over types that abstract over types ('higher-kinded types') ..." which suggests that class XClass[M[T]]{...} // or trait YTrait[N[_]]{...} // e.g. trait Functor[F[_]] is a higher kinded type.

因此,考虑到这一点,很难区分类型构造函数,高级类型类型和将类型构造函数作为类型参数的类型构造函数,因此出现了上面的问题。

在JS中是否有一种方法可以在HTML标签中获取整个HTML,作为字符串?

document.documentElement.??

在C/ c++中,全局变量像我的教授认为的那样糟糕吗?

我已经看到一些c++使用模板模板参数(即将模板作为参数的模板)来进行基于策略的类设计的示例。这种技术还有什么其他用途?

在Oracle数据库表中返回给定列的重复值及其出现次数的最简单SQL语句是什么?

例如:我有一个列为JOB_NUMBER的JOBS表。如何才能知道我是否有任何重复的JOB_NUMBERs,以及它们重复了多少次?

为什么在训练期间需要调用zero_grad() ?

|  zero_grad(self)
|      Sets gradients of all model parameters to zero.

我目前正在用Xcode 6 (Beta 6)测试我的应用程序。UIActivityViewController在iPhone设备和模拟器上工作得很好,但在iPad模拟器和设备(iOS 8)上崩溃

Terminating app due to uncaught exception 'NSGenericException', 
reason: 'UIPopoverPresentationController 
(<_UIAlertControllerActionSheetRegularPresentationController: 0x7fc7a874bd90>) 
should have a non-nil sourceView or barButtonItem set before the presentation occurs.

我使用以下代码用于iPhone和iPad的iOS 7以及iOS 8

NSData *myData = [NSData dataWithContentsOfFile:_filename];
NSArray *activityItems = [NSArray arrayWithObjects:myData, nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:nil applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeCopyToPasteboard];
[self presentViewController:activityViewController animated:YES completion:nil];

我得到一个类似的崩溃在我的另一个应用程序以及。你能引导我吗?ios8中的UIActivityViewController有什么变化吗?我查过了,但在这上面什么也没找到

我在Linux上运行Eclipse的Helios EE包,我添加了颠覆性的插件,m2e Maven集成和Trac的Mylin连接器。在过去的几个星期里,我一直在尝试安装更新,每次我都收到这样的消息

No repository found containing <something or other>

最新的一个是

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.eclipse.team.svn,0.7.9.I20110318-1700
No repository found containing: osgi.bundle,org.eclipse.team.svn.core,0.7.9.I20110523-1700
No repository found containing: osgi.bundle,org.eclipse.team.svn.help,0.7.9.I20110318-1700
No repository found containing: osgi.bundle,org.eclipse.team.svn.mylyn,0.7.9.I20110318-1700
No repository found containing: osgi.bundle,org.eclipse.team.svn.ui,0.7.9.I20110523-1700
No repository found containing: org.eclipse.update.feature,org.eclipse.team.svn,0.7.9.I20110523-1700
No repository found containing: org.eclipse.update.feature,org.eclipse.team.svn.mylyn,0.7.9.I20110523-1700
No repository found containing: org.eclipse.update.feature,org.eclipse.team.svn.resource.ignore.rules.jdt,0.7.9.I20110523-1700

这一切意味着什么,我该如何解决?如果Eclipse能够联系存储库来检查新文件,为什么它不能从这些存储库下载这些文件呢?或者错误消息意味着完全不同的东西?