我在maven设置文件〜/ .m2/settings.xml中默认激活了配置文件.
是否可以通过执行以下操作从命令行停用它:
mvn -P!profileActivatedByDefault
Run Code Online (Sandbox Code Playgroud) 我有一个简单的“ hello world”项目,我想测试著名的hélloWorld函数。
该项目的结构如下:
??? package.json
??? spec
? ??? helloWorldSpec.js
? ??? support
? ??? jasmine.json
??? src
??? helloWorld.js
Run Code Online (Sandbox Code Playgroud)
以及文件内容:
package.json
{
"name": "jasmineTest",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause",
"dependencies": {
"jasmine": "~2.1.0"
}
}
Run Code Online (Sandbox Code Playgroud)
spec / helloWorldSpec.js
// var helloWorld = require('../src/helloWorld.js');
describe('Test', function() {
it('it', function() {
helloWorld();
});
});
Run Code Online (Sandbox Code Playgroud)
src / helloWorld.js
function helloWorld() {
return "Hello world!"; …Run Code Online (Sandbox Code Playgroud) 如何使用流将列表转换为列表地图?
我想转换List<Obj>到Map<Obj.aProp, List<Obj.otherProp>>,
不仅List<Obj>要Map<Obj.aProp, List<Obj>>
class Author {
String firstName;
String lastName;
// ...
}
class Book {
Author author;
String title;
// ...
}
Run Code Online (Sandbox Code Playgroud)
这是我想要转换的列表:
List<Book> bookList = Arrays.asList(
new Book(new Author("first 1", "last 1"), "book 1 - 1"),
new Book(new Author("first 1", "last 1"), "book 1 - 2"),
new Book(new Author("first 2", "last 2"), "book 2 - 1"),
new Book(new Author("first 2", "last 2"), "book 2 - 2")
);
Run Code Online (Sandbox Code Playgroud)
我知道怎么做:
// …Run Code Online (Sandbox Code Playgroud)