我有一个使用 sbt(scala) 进行构建的 java 项目。直到昨天,这仍然有效,但今天我看到从 Maven 中提取回购的问题
esolving org.codehaus.plexus#plexus-component-api;1.0-alpha-16 ...
[error] SERVER ERROR: HTTPS Required url=http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
[warn]  module not found: org.codehaus.plexus#plexus-component-api;1.0-alpha-16
[warn] ==== typesafe-ivy-releases: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.codehaus.plexus/plexus-component-api/1.0-alpha-16/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.codehaus.plexus/plexus-component-api/1.0-alpha-16/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /root/.ivy2/local/org.codehaus.plexus/plexus-component-api/1.0-alpha-16/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   file:/heimdall/app/projects/load-test/content-engine/repository/org.codehaus.plexus/plexus-component-api/1.0-alpha-16/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.codehaus.plexus/plexus-component-api/1.0-alpha-16/ivys/ivy.xml
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/codehaus/plexus/plexus-component-api/1.0-alpha-16/plexus-component-api-1.0-alpha-16.pom
Run Code Online (Sandbox Code Playgroud)
根据我的推断,repo 似乎已移至 https 端点。并且 pom 文件在 https 端点上可用。问题是这不是我项目中的直接依赖项,而是通过其他一些依赖项传递过来的。如何将 https 用于此特定依赖项? …
I'm trying to set up personal git account along with my work account. I followed this guide https://www.freecodecamp.org/news/manage-multiple-github-accounts-the-ssh-way-2dadc30ccaca/ and my ~/.ssh/config is (some-name is my user name for personal github account)
host github.com
   Hostname github.com
   User git
   AddKeysToAgent yes
   UseKeychain yes
   IdentityFile ~/.ssh/id_rsa
host some-name.github.com
   Hostname github.com
   Identityfile ~/.ssh/id_rsa_personal
Run Code Online (Sandbox Code Playgroud)
After this, I ran ssh-add ~/.ssh/id_rsa_personal which was successful. 
However, when I do ssh -T some-name.github.com, it fails with 
somename@github.com: Permission denied (publickey)
The work account is working fine. I …
我正在使用 Couchbase 水槽连接器。CB 和 kafka 位于不同 AWS 区域的 2 个不同 EC2 实例中。我正在关注这些文档:
基于这些,我认为 connect 必须在也安装了 kafka 的主机上运行。我的连接是否可以在远程主机上运行,以便我从远程 kafka 读取并将消息接收到远程 CB 存储桶中?有专门针对此的文档吗?
另外,我收到以下错误:
        at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:79)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:66)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:118)
Caused by: org.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements Connector and which name matches com.couchbase.connect.kafka.CouchbaseSinkConnector, available connectors are: PluginDesc{klass=class org.apache.kafka.connect.file.FileStreamSinkConnector, name='org.apache.kafka.connect.file.FileStreamSinkConnector', version='2.3.0', encodedVersion=2.3.0, type=sink, typeName='sink', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.file.FileStreamSourceConnector, name='org.apache.kafka.connect.file.FileStreamSourceConnector', version='2.3.0', encodedVersion=2.3.0, type=source, typeName='source', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockConnector, name='org.apache.kafka.connect.tools.MockConnector', version='2.3.0', encodedVersion=2.3.0, type=connector, typeName='connector', location='classpath'}, PluginDesc{klass=class org.apache.kafka.connect.tools.MockSinkConnector, name='org.apache.kafka.connect.tools.MockSinkConnector', version='2.3.0', encodedVersion=2.3.0, type=sink, typeName='sink', …Run Code Online (Sandbox Code Playgroud) 我有一个 gRPC 服务器,并且我已经实现了 gRPC 服务器的正常关闭,如下所示
fun main() {
    //Some code
    term := make(chan os.Signal)
    go func() {
            if err := grpcServer.Serve(lis); err != nil {
                term <- syscall.SIGINT
            }
        }()
    signal.Notify(term, syscall.SIGTERM, syscall.SIGINT)
    <-term
    server.GracefulStop()
    closeDbConnections()
}
Run Code Online (Sandbox Code Playgroud)
这很好用。如果我grpcServer.Serve()在主 goroutine 中编写逻辑,并将关闭处理程序逻辑放入另一个 goroutine 中,则之后的语句server.GracefulStop()通常不会执行。一些 DbConnections 如果closeDbConnections()执行的话,会被关闭。
server.GracefulStop()是一个阻塞调用。绝对在完成grpcServer.Serve()之前完成server.GracefulStop()。那么,在这个调用返回后,main goroutine 需要多长时间才能停止呢?
有问题的代码
func main() {
    term := make(chan os.Signal)
    go func() {
        signal.Notify(term, syscall.SIGTERM, syscall.SIGINT)
        <-term
        server.GracefulStop()
        closeDbConnections()
    }()
    if err := grpcServer.Serve(lis); …Run Code Online (Sandbox Code Playgroud) 编写这个非常基本的代码来理解通道。
如果一个 Goroutine 中有等待,为什么主 Goroutine 还要等待它呢?我读到主 Goroutine 需要有一个等待时间,因为在调用 Goroutine 后控制权会立即传回给它。
为什么goroutine不像java中的主线程和子线程那样设计可以并行运行?
func main() {
    channel := make(chan int)
    go func() {
        time.Sleep(3*time.Second)
    }()
    for {
        fmt.Println("../");
        <-channel
    }
}
Run Code Online (Sandbox Code Playgroud)