小编Chr*_*ris的帖子

多个正则表达式@ Pattern用于1场?

我试图将多个@Pattern注释应用于单个字段:

@Pattern(regexp = "(?=.*[0-9])", message = "Password must contain one digit.")
@Pattern(regexp = "(?=.*[a-z])", message = "Password must contain one lowercase letter.")
@Pattern(regexp = "(?=.*[A-Z])", message = "Password must contain one uppercase letter.")
@Pattern(regexp = "(?=\S+$)", message = "Password must contain no whitespace.")
private String password;
Run Code Online (Sandbox Code Playgroud)

但是,我不能这样做.我想要在密码字段上违反正则表达式约束的单个邮件.这可能吗?

我的替代方案是使用JSF 2.0 f:validatorRegex标记.

regex java-ee bean-validation

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

SonarQube - 临时目录不可写

我正在安装SonarQube v5.0.1.

我正在运行Windows Server 2012 64位,Java 1.8 64位和SonarQube windows-x86-64包装器.

SonarQube不断抛出以下错误:

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\
java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\
    at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:60)
    at org.sonar.process.MinimumViableSystem.checkWritableTempDir(MinimumViableSystem.java:52)
    at org.sonar.process.MinimumViableSystem.check(MinimumViableSystem.java:45)
    at org.sonar.application.App.main(App.java:113)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createTempFile(Unknown Source)
    at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:57)
    ... 9 more
<-- Wrapper Stopped
Run Code Online (Sandbox Code Playgroud)

为什么SonarQube会继续尝试写入C:\ …

sonarqube sonarqube-5.0

11
推荐指数
2
解决办法
8300
查看次数

如何配置settings.xml以从Artifactory私有虚拟存储库中提取?

我是Apache Archiva的资深人士,他最近转投Artifactory Pro.我一直试图在Artifactory中复制一个我在Archiva中实现虚拟私有存储库的设置.最终结果应该是不同的团队可以访问他们自己团队的工件,远程存储库,默认本地存储库和公司范围的存储库.

但是,每当我配置我的Maven settings.xml以使用我的私有虚拟存储库时,我只能下载一些依赖项,这些依赖项可以从Maven Central获取和从中提取.如果我使用Artifactory的默认settings.xml(libs-release,libs-snapshot,plugins-release,plugins-snapshot和no virtual repository),那么我可以下载Maven Central上可用的所有依赖项以及我的项目所需的依赖项.

我在Windows服务器2012虚拟服务器上运行他们提供的Tomcat上的Artifactory v4.4.2.我没有在代理后面跑.我对Archiva没有这样的问题.

关于我的私有虚拟存储库设置,我有一个名为"test"的虚拟存储库,它是一个"通用"软件包类型.该存储库包含以下存储库:

  • 远程回购
  • 库释放
  • 库快照
  • 插件释放
  • 插件快照
  • 测试释放本地
  • 测试快照,本地
  • 公司释放本地
  • 公司快照本地

列出的前5个repos是提供Artifactory的默认虚拟存储库repos.列出的最后4个回购是本地回购,它们是通用包类型.

我想我应该用镜子.

这是我正在使用的一个示例settings.xml(我的用户名和密码将填充在我保存到我的Maven conf文件夹的生成的settings.xml中):

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
      <id>central</id>
    </server>
    <server>
      <username>${security.getCurrentUsername()}</username>
      <password>${security.getEscapedEncryptedPassword()!"*** Insert encrypted password here ***"}</password>
      <id>snapshots</id>
    </server>
  </servers>
  <mirrors>
    <mirror>
      <mirrorOf>*</mirrorOf>
      <name>test</name>
      <url>http://localhost:8082/artifactory/test</url>
      <id>test</id>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://localhost:8082/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id> …
Run Code Online (Sandbox Code Playgroud)

java maven-2 artifactory maven-3 maven

4
推荐指数
2
解决办法
2万
查看次数

SonarQube - 无法加载Wrapper的本机库'wrapper.dll'

我正在安装SonarQube v5.0.

我正在运行Windows Server 2012 64位(虚拟操作系统),Java 1.8 64位和SonarQube windows-x86-64包装器.

SonarQube,无论是使用命令提示符作为管理员还是作为Windows服务通过StartSonar.bat运行,都会不断发出以下警告:

WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.
      The file is located on the path at the following location but
      could not be loaded:
        C:\sonarqube-5.0.1\bin\windows-x86-64\.\lib\wrapper.dll
      Please verify that the file is readable by the current user
      and that the file has not been corrupted in any way.
      One common cause of this problem is running a 32-bit version
      of the Wrapper with a 64-bit version of Java, or …
Run Code Online (Sandbox Code Playgroud)

sonarqube sonarqube-5.0

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