小编Pis*_*ete的帖子

可以将应用程序从后台带到前台吗?

运行XCT UI测试时,可以在后台运行正在测试的应用程序:

XCUIDevice().pressButton(XCUIDeviceButton.Home)
Run Code Online (Sandbox Code Playgroud)

它可以以某种方式将应用程序恢复到前台(活动状态)而无需重新启动应用程序?

ios swift xcode7 xcode-ui-testing

14
推荐指数
2
解决办法
6823
查看次数

maven-dependency-plugin:解包错误

我正在尝试从依赖jar文件中提取一些.exe文件,并将它们放在$ {project.build.directory}/classes /下.

但是当我执行时:

mvn clean编译依赖:unpack

我得到:

无法执行目标org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack(default-cli)项目简单:需要artifact或artifactItems - > [帮助1

我已经验证了依赖项在我的本地存储库中可用.

在我的示例pom中,我使用junit作为示例,但无论我列出哪个依赖项,我都会得到相同的错误.

pom.xml中:

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.10</version>
                  <type>jar</type>
                  <overWrite>false</overWrite>
  <outputDirectory>${project.build.directory}/classes/externaltools</outputDirectory>                   
                  <includes>**/*.txt</includes>
                </artifactItem>
              </artifactItems>   
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)

maven-3 maven-dependency-plugin

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

Javadoc:错误 - 找不到doclet类

我正在尝试使用Windows命令行中的自定义doclet运行Javadoc:

javadoc -classpath C:\path\to\build\dir -sourcepath C:\path\to\src\dir -doclet somePackageName.customDocletClassFileName anotherPackageName
Run Code Online (Sandbox Code Playgroud)

"anotherPackageName"是直接在给定源路径下的包,我想为其生成文档.

当我像这样执行它时,我得到错误:

javadoc: error - Cannot find doclet class somePackageName.customDocletClassFileName 
Run Code Online (Sandbox Code Playgroud)

似乎-classpath标志有什么问题,任何想法?

如果我替换

-doclet somePackageName.customDocletClassFileName
Run Code Online (Sandbox Code Playgroud)

-docletpath somePackageName
Run Code Online (Sandbox Code Playgroud)

它工作得更好(虽然我没有真正验证输出,因为我没有将testng jar添加到类路径,然后还有很多其他问题).

javadoc

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

Jenkins,在多个用户的ssh上获取git子模块?

不知道标题是否描述了我想说的内容,但这里是:

我想知道使用git子模块设置Jenkins时的"最佳实践".main和submodule repo都可以通过ssh访问,因为我们有几个用户,所有这些用户都有自己的用户名.对于拥有自己用户的Jenkins也是如此.但是,我们(我)偶然发现了一个问题.如果我创建一个子模块: git submodule添加ssh:// my-user-name @ address-to-module-repo推送它,Jenkins会在尝试获取子模块时将我称为用户,这显然会失败.如果其他一些用户执行了拉取,我的用户名仍然在路径中(在.gitmodule,.git/config等等).

我在"普通"用户之间发现了另一个帖子Git子模块和ssh访问处理共享,但是当Jenkins尝试构建时,它并没有真正解决问题,因为我只允许在Jenkins取出所有我无法执行的操作后执行shell cmd如链接中提到的那样,还是可以(Jenkins新手)?

所以,总结一下.如何解决这个问题,以便在通过ssh获取子模块时Jenkins将使用自己的用户?

Br,Pistol先生

git ssh fetch git-submodules jenkins

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

来自powershell的ant命令 - dot用作参数的分隔符?

我正在尝试运行一个我正在从PowerShell脚本调用的ant任务:

Invoke-Expression "ant -f $antFilePath -Dtestsuite=$testsuite clean compile run"
Run Code Online (Sandbox Code Playgroud)

$ testsuite变量是一个包含点字符的字符串,例如"systemTest.All",所以:

Invoke-Expression "ant -f $antFilePath -Dtestsuite=systemTest.All clean compile run"
Run Code Online (Sandbox Code Playgroud)

我的问题是点似乎被解释为分隔符(通过powershell?从cmd调用工作得很好),因此"全部"部分被视为一个蚂蚁目标(在干净的编译运行中).

(在testuite名称中使用点不是我的做法之一,所以我不能影响到第一部分)

我是否需要对蚂蚁论证进行评估,以某种方式逃避点?

Br,Pete

ant powershell

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

使用相对路径复制文件

我想从某个子目录复制某个类型的所有文件,其中包含从该子目录到相对路径完整的另一个目录的相对路径.例如:

来源子目录:

c:\temp\sourcedirectory
Run Code Online (Sandbox Code Playgroud)

源文件:

c:\temp\sourcedirectory\tonymontana\fileOne.txt
c:\temp\sourcedirectory\poker\fileTwo.txt
Run Code Online (Sandbox Code Playgroud)

目标目录:

c:\temp\targetdirectory
Run Code Online (Sandbox Code Playgroud)

期望的结果:

c:\temp\targetdirectory\tonymontana\fileOne.txt
c:\temp\targetdirectory\poker\fileTwo.txt
Run Code Online (Sandbox Code Playgroud)

到目前为止,我想出了:

Set-Location $srcRoot
Get-ChildItem -Path $srcRoot -Filter $filePattern -Recurse |
    Resolve-Path -Relative |
    Copy-Item -Destination {Join-Path $buildroot $_.FullName}
Run Code Online (Sandbox Code Playgroud)

然而,PowerShell的这一切"一切都是一个对象"正在击败我(至少我怀疑这是).即文件被复制,但没有相对路径.

谁可以开导我一点?

powershell

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