当我在maven项目上尝试Jenkins构建时,我收到此错误:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
Run Code Online (Sandbox Code Playgroud)
在java的和Maven的插件将自动安装,一些研究之后,我无法找到一个解决方案!
有没有人遇到过这个问题?
这个问题已被多次询问,但我找不到解决问题的答案.
我正在尝试将嵌套的JSON格式转换为CSV格式,如下所示:
该JSON结构是任意的,并可以是任何东西,嵌套与否.
我不想知道它,这是一个数据库答案,我需要将这个JSON答案导出到CSV文件中.
这是一个例子
输入:
{
"_id": 1,
"name": "Aurelia Menendez",
"scores": [
{
"type": "exam",
"score": 60.06045071030959
},
{
"type": "quiz",
"score": 52.79790691903873
},
{
"type": "homework",
"score": 71.76133439165544
}
]
}
Run Code Online (Sandbox Code Playgroud)
我正在寻找的输出:
_id,name,scores.type,scores.score,scores.type,scores.score,scores.type,scores.score
1,Aurelia Menendez,exam,60.06...,quiz,52.79...,homework,71.76..
Run Code Online (Sandbox Code Playgroud)
这是一个示例,它可以是任何其他JSON文档.
这里的想法是在CSV列名称中使用点表示法.
我已经使用过CDL,但输出不是我想要的:
_id scores name
1 "[{score:60.06045071030959,type:exam},{score:52.79790691903873,type:quiz},{score:71.76133439165544,type:homework}]" Aurelia Menendez
Run Code Online (Sandbox Code Playgroud)
那么如何使用点表示法以通用方式将嵌套的JSON转换为CSV?
编辑
使用Jackson对JSON进行反序列化:
ObjectMapper mapper=new ObjectMapper();
JsonNode jsonNode=mapper.readValue(new File("C:\\...\\...\...\\test.json"), JsonNode.class);
Run Code Online (Sandbox Code Playgroud)
伊斯梅尔
我正在尝试用Sonar 4.2分析我的JEE项目.这是一个使用Java和JS的多语言JEE项目.
我添加到Sonar 4.2的插件是:Java 2.1和JavaScript 1.6.
近日,声纳增加了多语言的分析,下面的文档,我已经去除了sonar.language从sonar-project.properties.但它仍然只分析Java.
我在Jenkins 1.555中使用Sonnar Runner 2.3.它在每次构建后分析项目.
我错过了什么吗?
编辑:sonar-project.properties:
# Required metadata
sonar.projectKey=myProjectKey
sonar.projectName=MyProject
sonar.projectVersion=1.0
# Path to the parent source code directory.
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional. …
Run Code Online (Sandbox Code Playgroud) 如何在关闭应用程序之前显示MessageDialog来实现IWindowCloseHandler?
这是我的代码:
编辑
public class LifeCycle {
@PostContextCreate
public void postContextCreate()
{
// TODO start up code here
System.out.println("open");
}
@ProcessAdditions
void processAdditions(MApplication app, EModelService modelService)
{
WindowCloseHandler closeHandler=new WindowCloseHandler();
MWindow window = (MWindow)modelService.find("uploadcenter.source.trimmedwindow.0", app);
window.getContext().set(IWindowCloseHandler.class, closeHandler);
}
private static class WindowCloseHandler implements IWindowCloseHandler{
@Override
public boolean close(MWindow window) {
// TODO Auto-generated method stub
Shell shell = new Shell();
if (MessageDialog.openConfirm(shell, "Confirmation",
"Do you want to exit?")) {
return true;
}
return false;
}
} …
Run Code Online (Sandbox Code Playgroud)