小编Vik*_*alk的帖子

使用Maven资源保留文件的权限:testResources

是否可以使用Maven资源保留文件的权限:testResources?我的用例是一个Selenium二进制驱动程序,我放在/ src/test/resources中,我希望能够在我的测试中使用它.然而,我的-rwxr-xr-x在目标/测试类中变为-rw-r - r--

file-permissions maven maven-resources-plugin

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

使用SBT和SNAPSHOT依赖项脱机工作

在任何项目中,我都无法使用SBT脱机工作.现在我正处于行动中,我的衣柜服务器托管nexus处于脱机状态.

所以跑步说:

sbt "set offline := true" run
Run Code Online (Sandbox Code Playgroud)

我得到了其他缺少的deps:

[error] unresolved dependency: se.hedefalk#lift-utils_3.0_2.10;0.2-SNAPSHOT: not found
Run Code Online (Sandbox Code Playgroud)

对于声明为的依赖:

"se.hedefalk"       %% ("lift-utils_"+liftEdition) % ("0.2-SNAPSHOT"),
Run Code Online (Sandbox Code Playgroud)

但我确实在我的常春藤缓存中有依赖:

$ ll ~/.ivy2/cache/se.hedefalk/lift-utils_3.0_2.10/
total 32
drwxr-xr-x  8 viktor  staff   272B Mar 14 11:36 ./
drwxr-xr-x  5 viktor  staff   170B Mar  8 10:38 ../
drwxr-xr-x  3 viktor  staff   102B Mar 14 11:36 docs/
-rw-r--r--  1 viktor  staff   4.5K Mar  4 15:54 ivy-0.2-SNAPSHOT.xml
-rw-r--r--  1 viktor  staff   4.0K Mar  4 15:54 ivy-0.2-SNAPSHOT.xml.original
-rw-r--r--  1 viktor  staff   1.8K Mar 14 11:36 …
Run Code Online (Sandbox Code Playgroud)

scala snapshot ivy sbt

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

什么放在package.json类型字段中的基于打字稿的库

关于如何最好地与代码导航并行开发多个打字稿模块并仍然以正确的方式发布,我有点困惑.那么我应该把它放在package.json"types"字段中呢?

根据:Typescriptlang.org/publishing.html

我应该index.d.ts像我这样生成一个引用:

{
    "name": "awesome",
    "author": "Vandelay Industries",
    "version": "1.0.0",
    "main": "./lib/main.js",
    "types": "./lib/main.d.ts"
}
Run Code Online (Sandbox Code Playgroud)

如果我然后并行开发一个依赖于此模块的模块,npm link例如vscode中的代码导航会让我跳转到这个定义文件中.这不是我想要的.

我想进入源文件,以便能够在dep中并行编辑.在这方面没有内联或无内联的tsconfig设置有帮助.我可能会在这里遗漏一些东西.我管理我的工作流程以正常工作的唯一方法是实际指向源main.ts文件:

{
    "name": "awesome",
    "author": "Vandelay Industries",
    "version": "1.0.0",
    "main": "./lib/main.js",
    "types": "./src/main.ts"
}
Run Code Online (Sandbox Code Playgroud)

然而,这会在发布时让事情破裂吗?

至少如果我把src放在.npmignore下面.我无法理解使用多个打字稿模块获得良好工作流程的最佳方法.

我的意思是,我不想将package.json作为发布过程的一部分进行修改......?

typescript visual-studio-code

12
推荐指数
2
解决办法
3484
查看次数

Scala SortedSet - 按一个排序和其他东西排序?

假设我有一组字符串,我希望按长度排序,但通过正常的String唯一性进行排序.我的意思是我可以拥有多个相同长度的字符串Set,但是它们应该按长度排序.

我想表达这样的顺序:

val orderByLength = Ordering[Int].on[String](_ length)
Run Code Online (Sandbox Code Playgroud)

我觉得看起来很不错.但如果我把它扔进SortedSet,就像这样说:

scala> val s = SortedSet("foo", "bar")(orderByLength)
s: scala.collection.immutable.SortedSet[java.lang.String] = TreeSet(bar)
Run Code Online (Sandbox Code Playgroud)

我只得到'酒吧'.这是因为它Ordering表示总排序,因此当compare返回0时,元素被认为是相同的.

因此,我认为如果长度相等,我需要进行链式排序并比较字符串.为此,我使用了"pimp my library" - 这样的模式:

trait ChainableOrderings {
  class ChainableOrdering[T](val outer: Ordering[T]) {
    def ifEqual(next: Ordering[T]): Ordering[T] = new Ordering[T] {
      def compare(t1: T, t2: T) = {
        val first = outer.compare(t1, t2)
        if (first != 0) first else next.compare(t1, t2)
      }
    }
  }
  implicit def chainOrdering[T](o: Ordering[T]) = new ChainableOrdering[T](o)
}
Run Code Online (Sandbox Code Playgroud)

我可以使用像: …

scala scala-collections

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

不能在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin

我正在使用org.jvnet.jax-ws-commons:jaxws-maven-plugin为Soap服务生成客户端存根.升级到JDK8使此失败,并出现以下错误:

Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
Run Code Online (Sandbox Code Playgroud)

和类似的东西

Failed to read DTD 'XMLSchema.dtd', because 'file' access is not allowed due to restriction set by the accessExternalDTD property.
Run Code Online (Sandbox Code Playgroud)

为什么这样,我该如何解决这个问题?

java soap web-services jax-rs maven

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

无法从货物部署到Tomcat7

我正在尝试通过https从Maven部署到远程Tomcat7.

我已经设置了manager-script角色,并且我已经成功地能够远程取消部署应用程序.

我看起来像这样:

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.1.2</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
            <type>remote</type>
        </container>

        <configuration>
            <type>runtime</type>
            <properties>
                <cargo.remote.uri>https://xxx/manager/text</cargo.remote.uri>
                <cargo.remote.username>${tomcat.username}</cargo.remote.username>
                <cargo.remote.password>${tomcat.password}</cargo.remote.password>
            </properties>
        </configuration>

        <deployer>
            <type>remote</type>
            <deployables>
                <deployable>
                    <groupId>mycomp</groupId>
                    <artifactId>myartifact</artifactId>
                    <type>war</type>
                    <properties>
                        <context>/</context>
                    </properties>
                </deployable>
            </deployables>
        </deployer>

    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

好吧,我知道凭据和一切都设置正确,我已经使用了新的/文本界面,我已经能够取消部署现有的应用程序.但是在尝试运行部署时:

mvn cargo:deployer-deploy -e
Run Code Online (Sandbox Code Playgroud)

我的根本原因是错误的:

Caused by: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2809)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2792)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:605)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:569)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
... 25 more
Run Code Online (Sandbox Code Playgroud)

我马上得到它所以它不能超时.

文件可以变大吗?这是一场60 MB的战争.我确保我的nginx允许更大:

client_max_body_size 200M;
Run Code Online (Sandbox Code Playgroud)

我还在管理器webapps …

maven-cargo tomcat7

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

如何最好地将偏移位置解析为 vscode DefinitionProvider 中的行、列位置

我正在将我的 Atom 包移植到 vscode 中,以便将 ensime 集成到其中。

\n\n

当尝试进行定义提供者时,我遇到了一个问题。ensime-server 为我提供了绝对字符位置,但 DefinitionProvider 协议要求行、列。只要我有文档,这就不是问题,因为我可以简单地执行此操作document.positionAt(offset),但是document.offsetAt(position)在定义提供者的范围内,我实际上还没有打开任何文档,我认为我不应该只是解析位置,因为 vscode 也使用它来悬停 info\xe2\x80\xa6

\n\n

这是我的wip:https://github.com/hedefalk/ensime-vscode/commit/57ed65f06e64e7f8969e08a8ac676d2c241287d1#diff-ee758fbdcafb036ed84d706f8b6f42a1R19

\n\n

将字符偏移解析为所需的 vscode.Position 的最佳选择是什么?有没有我可以使用的快速文件阅读器?我真的不想从外部打开文件。

\n

visual-studio-code vscode-extensions

7
推荐指数
0
解决办法
1274
查看次数

VSCode 金属,在 Scalatest 中运行特定十

有没有办法在 vscode 中使用金属 scala 插件,运行特定的测试场景?就像在 IntelliJ 中一样?

scala visual-studio-code scala-metals

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

sbt插件没有从子模块中获取?

我正在尝试将单个模块项目转换为具有根聚合的两个模块.感觉像是正常的事情.

所以,为了简化我删除了我添加的第二个项目,但我做了类似的事情:

cd myproject
mkdir core
mv * core
Run Code Online (Sandbox Code Playgroud)

然后在myproject中添加一个build.sbt

lazy val root = project.in( file(".") ).aggregate(core)
lazy val core = project in file("core")
Run Code Online (Sandbox Code Playgroud)

但是,尝试构建核心我得到:

[myproject] /core/build.sbt:22:错误:找不到:值lessSettings seq(lessSettings:_*)

这是现在原始项目的project/plugins.sbt中添加的插件的设置

[myproject]/core/project/plugins.sbt
Run Code Online (Sandbox Code Playgroud)

怎么没有拿起来?我不能只在子模块中生活插件吗?cd:进入核心子模块并运行sbt它运行得很好.我必须将我的插件移动到root/project吗?相当不错,不是这样吗?

sbt multi-module

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

如何在多阶段Docker构建的各个阶段之间复制变量?

我仅看到了使用COPY在多阶段Dockerfile的各个阶段之间复制文件的示例,但是有没有一种方法可以简单地复制ENV变量?我的用例是从git图像开始,只是要获取将作为构建一部分的提交哈希。我稍后使用的图像还没有git。

我意识到我可以将git哈希输出到文件中并使用COPY,但我只是想知道是否有更清洁的方法?

dockerfile docker-build docker-multi-stage-build

6
推荐指数
2
解决办法
465
查看次数