小编Aar*_*ock的帖子

无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

我正在尝试安装stanbol并收到以下错误

无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test

附加错误日志

[信息]

[错误]无法在项目org.apache.stanbol.entityhub.ldpath上执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test(default-test):存在测试失败.[错误] [错误]请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports了解各个测试结果.

[错误] - > [帮助1] org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目组织上执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test(default-test) .apache.stanbol.entityhub.ldpath:有测试失败.

有关各个测试结果,请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports.org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)位于org.apache.maven.life循环的org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) .internal.MojoExecutor.execute(MojoExecutor.java:145)org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder) .java:80)org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) )org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)atg.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)atg.apache.maven.cli.MavenCli.execute(MavenCli. java:584)org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)at sun.reflect.Nat 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中的iveMethodAccessorImpl.invoke0(本地方法),位于java.lang.reflect.Method.invoke(方法. java:606)org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)at org.codehaus .plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)引起:org.apache.maven.plugin.MojoFailureException :有测试失败.

有关各个测试结果,请参阅/ home/stanbol-trunk/entityhub/ldpath/target/surefire-reports.在Org.apache.maven.maven.malu.上的org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:254) .surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:854)org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:722)org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java) :132)在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)... 19更多

[错误]

[错误]

[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:[错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[错误]

[错误]纠正问题后,您可以使用该命令恢复构建

[错误] mvn -rf:org.apache.stanbol.entityhub.ldpath

java maven-3 maven apache-stanbol

9
推荐指数
1
解决办法
6万
查看次数

当pip和conda重叠时该怎么办?

我对conda install&之间的区别有一个合理的理解pip install; 如何pip只安装python包并conda可以安装非python二进制文件.但是,这两者之间存在一些重叠.这让我想问:

对于是否使用condapip两者都提供包装有什么经验法则?

例如,TensorFlow两个存储库都可以使用,但是来自tensorflow文档:

在Anaconda中,我们建议使用pip install命令安装TensorFlow ,而不是使用conda install命令.

但是,有许多重叠的其他包一样numpy,scipy等等.


但是,此Stackoverflow答案表明conda install应该是默认值,并且pip只应在包不可用时使用conda.即使对于TensorFlow其他仅限python的包,这是真的吗?

python numpy pip conda

9
推荐指数
1
解决办法
1929
查看次数

Terraform 可选 jsonencode 属性

好的,获取以下 terraform 片段:

variable "my_var1" {
  type    = string
  default = null
}
variable "my_var2" {
  type    = string
  default = null
}
output "my_out" {
  value = jsonencode({
    my_attribute1 = var.my_var1
    my_attribute2 = var.my_var2
  })
}
Run Code Online (Sandbox Code Playgroud)

我希望如果没有指定my_var1& my_var2,它们就不会出现在my_out任何内容中。(即输出将是{})但是当前的输出是:

my_out = {"my_attribute1":null,"my_attribute2":null}
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?(最好不必直接切换到 json 文本中的字符串插值)

json terraform

8
推荐指数
1
解决办法
2565
查看次数

找到一个4位数字,其正方形是8位数,最后4位是原始数字

我在这里答案的评论,问的问题(释义):

编写一个Python程序来查找一个4位数的整数,当它与自身相乘时,得到一个8位整数,其最后4位数等于原始数.

我会发布我的答案,但我对更优雅的解决方案感兴趣,简洁但易读的解决方案!(有人会对python有什么新的理解吗?)

python math integer-arithmetic

7
推荐指数
5
解决办法
2121
查看次数

将int指针设置为int Value Golang

我是Go的新手,并试图设定一个*int指向一个数字,比方说12345.

package main

import (
    "fmt"
    "reflect"
)

func main() {
    var guess *int
    fmt.Println(reflect.TypeOf(guess))
    *guess = 12345
    fmt.Println(guess)
}
Run Code Online (Sandbox Code Playgroud)

但它给了我以下错误:

Type: *int
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x483c7d]

goroutine 1 [running]:
main.main()
    /home/aaron/projects/gopath/src/github.com/AaronNBrock/go-guess/main.go:16 +0x9d
exit status 2
Run Code Online (Sandbox Code Playgroud)

我看到错误是*guess = 12345从那以后12345,但我不确定是什么导致它.

pointers go

3
推荐指数
2
解决办法
3968
查看次数

熊猫内部与Lambda加入

我有以下两个框架:

框架1:

            id
0  111-111-111
1  111-111-222
2  222-222-222
3  333-333-333
Run Code Online (Sandbox Code Playgroud)

框架2:

     data       id
0    ones  111-111
1  threes  333-333
Run Code Online (Sandbox Code Playgroud)

而且,我有一个lambda函数将映射frame1.idframe2.id

id_map = lambda x: x[:7]
Run Code Online (Sandbox Code Playgroud)

我的目标是在这两个表之间执行内部联接,但要让ID通过lambda。这样的输出是:

            id    data
0  111-111-111    ones
1  111-111-222    ones
2  333-333-333  threes
Run Code Online (Sandbox Code Playgroud)

我想出了一个非常优雅的解决方案,几乎可以完成我想做的事情,但是当内部联接删除行时,它就变得混乱了:

# Save a copy the original ids of frame1
frame1_ids = frame1['id'].copy()
# Apply the id change to frame1
frame1['id'] = frame1['id'].apply(id_map)
# Merge
frame1 = frame1.merge(frame2, how='inner', on='id')
# Set the ids back to …
Run Code Online (Sandbox Code Playgroud)

python lambda join inner-join pandas

1
推荐指数
1
解决办法
880
查看次数

Kubernetes 将回声重定向到文件而不是创建文件

我的目标是编写一个简单的 init pod 以使用重定向 ( >)将某些内容回显到文件中以进行测试,而是打印重定向和文件名。这是我的 yaml 的相关部分:

  initContainers:
  - name: cat-to-file
    image: alpine
    args: [ "echo", "Hello, World", ">", "test"]
    workingDir: /project
    volumeMounts:
    - name: project-files
      mountPath: /project
Run Code Online (Sandbox Code Playgroud)

但是,文件没有被创建,当我通过以下方式查看容器日志时:

kubectl logs <pod id> cat-to-file
Run Code Online (Sandbox Code Playgroud)

它告诉我:

Hello, World, > test
Run Code Online (Sandbox Code Playgroud)

这让我觉得它是在回应> test标准输出而不是一个名为test.

我在这里做错了什么?

kubernetes

1
推荐指数
1
解决办法
972
查看次数