小编Wim*_*uwe的帖子

maven项目有多个父母吗?

我们有java和flex项目在起作用.我们目前有1个基本pom,其中包含我们要用于两个项目的配置.问题是:flex项目继承javadoc和pmd的配置,例如,他们不想要.

我想要做得更干净一点,有一个真正的基础,然后是一个java-base-pom和一个flex-base-pom.但是,如何在具有flex部分和java部分的多模块中工作?

我们有自己的应用程序的插件,我们使用以下结构:

  • 我-插件
    • my-plugin-client(flex)
    • my-plugin-server(java)

my-plugin只包含一个带有section的pom.xml.我会使用my-plugin pom.xml作为两者的父级,但是我也不能将java base-pom或flex base-pom也用作父级.对此最好的评价是什么?

java apache-flex maven-2 code-organization

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

SVN预提交钩子,用于避免更改标签子目录

有没有人有关于如何添加预提交钩子的明确说明,以避免更改标签子目录?

我已经在互联网上搜索了一下.我发现这个链接:SVN :: Hooks :: DenyChanges,但我似乎无法编译.

svn tags pre-commit svn-hooks

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

无法使用Spring Boot和Thymeleaf进行验证

我有一个Spring Boot应用程序(使用版本1.2.3)和一个显示表单的控制器.这一切都很好,但现在我想添加验证.我在我的控制器中有这个方法:

@RequestMapping(value = "/licensing", method = RequestMethod.POST)
public String doRegistration( @Valid CustomerLicenseRegistration customerLicenseRegistration, Model model, BindingResult bindingResult )
{
    if( bindingResult.hasErrors())
    {
        logger.debug( "There are errors! {}", bindingResult );
        return "customer/license-registration";
    }
    logger.debug( "customerLicenseRegistration: " + customerLicenseRegistration );
    CustomerLicense customerLicense = m_licenseService.createCustomerLicense( customerLicenseRegistration );
    model.addAttribute( "customerLicense", customerLicense );
    return "customer/license-registration-done";
}
Run Code Online (Sandbox Code Playgroud)

如果我现在键入一些无效的东西,我会在提交后得到"Whitelabel错误页面",并且我的方法中的断点永远不会被击中(如果我删除了@Valid注释,断点就会被击中).错误页面显示:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon May 18 09:42:27 CEST 2015 …
Run Code Online (Sandbox Code Playgroud)

java validation spring spring-mvc

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

如何以编程方式在spring boot中向/ info端点添加内容?

如何以编程方式/infoSpring Boot中向端点添加内容?该文件指出,这是可能的/health,通过使用端点HealthIndicator接口./info端点也有什么东西吗?

我想在那里添加操作系统名称和版本以及其他运行时信息.

spring-boot

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

无法让Swagger UI与Spring启动一起使用

我试图让Swagger UI使用Spring Boot 1.2.1.我按照https://github.com/martypitt/swagger-springmvc上的说明操作,然后添加@EnableSwagger了我的spring配置.

我现在回到JSON http://localhost:8080/api-docs但是没有好的HTML.

我正在使用Maven并添加了对swagger-ui的依赖:

<dependency>
    <groupId>org.ajar</groupId>
    <artifactId>swagger-spring-mvc-ui</artifactId>
    <version>0.4</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

这是我完整的依赖列表:

<dependencies>
        <dependency>
            <groupId>com.mangofactory</groupId>
            <artifactId>swagger-springmvc</artifactId>
            <version>0.9.4</version>
        </dependency>
        <dependency>
            <groupId>org.ajar</groupId>
            <artifactId>swagger-spring-mvc-ui</artifactId>
            <version>0.4</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
Run Code Online (Sandbox Code Playgroud)

我也尝试http://localhost:8080/docs/index.html过URL,但这只是给出了"Whitelabel错误页面"

更新:

我在Github上创建了一个测试项目以显示问题:https://github.com/wimdeblauwe/springboot-swagger-test

swagger swagger-ui spring-boot

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

Jenkins中"在构建开始之前删除工作区"和"擦除存储库和强制克隆"之间的区别?

我正在测试jenkins job-dsl插件.我有一个现有项目,其中启用了"在构建开始之前删除工作区"设置.

我定义了以下DSL:

job("$basePath/my-project") {
    scm {
        git {
            remote {
                name('origin')
                url('git@bitbucket.org:my-organisation/my-project.git')
            }
            branch('*/develop')
            extensions {
                wipeOutWorkspace()
                submoduleOptions {
                    recursive()
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这似乎给出了一个不完全相同的配置,它显示了"擦除存储库和强制克隆"选项.这些选项最终是否完全相同或是否存在不同的行为?

jenkins jenkins-job-dsl

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

如何在Spring中使用JDBC为ClientDetailsS​​erviceConfigurer添加客户端?

我记忆中的事情如下:

@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {

        clients.inMemory()
               .withClient("clientapp")
               .authorizedGrantTypes("password", "refresh_token")
               .authorities("USER")
               .scopes("read", "write")
               .resourceIds(RESOURCE_ID)
               .secret("123456");
}
Run Code Online (Sandbox Code Playgroud)

我想使用JDBC实现.为此,我创建了以下表(使用MySQL):

-- Tables for OAuth token store

CREATE TABLE oauth_client_details (
  client_id               VARCHAR(255) PRIMARY KEY,
  resource_ids            VARCHAR(255),
  client_secret           VARCHAR(255),
  scope                   VARCHAR(255),
  authorized_grant_types  VARCHAR(255),
  web_server_redirect_uri VARCHAR(255),
  authorities             VARCHAR(255),
  access_token_validity   INTEGER,
  refresh_token_validity  INTEGER,
  additional_information  VARCHAR(4096),
  autoapprove             TINYINT
);

CREATE TABLE oauth_client_token (
  token_id          VARCHAR(255),
  token             BLOB,
  authentication_id VARCHAR(255),
  user_name         VARCHAR(255),
  client_id         VARCHAR(255)
);

CREATE TABLE oauth_access_token (
  token_id          VARCHAR(255),
  token             BLOB,
  authentication_id VARCHAR(255), …
Run Code Online (Sandbox Code Playgroud)

java mysql spring-security-oauth2

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

如何使用checkstyle maven插件完全禁用javadoc检查

我想使用Maven Checkstyle插件,其自定义配置告诉Checkstyle不会在丢失Javadoc时发出警告或错误.有没有办法做到这一点?

checkstyle maven

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

如何使用Spring Boot将目录放在classpath上?

我正在使用Maven构建我的Spring Boot应用程序,所以我可以使用以下命令启动它:

java -jar myjar-1.0-SNAPSHOT.jar --spring.profiles.active=prod
Run Code Online (Sandbox Code Playgroud)

我希望首先在类路径上有一个目录,这样我就可以在文件系统上放置一些文件,而无需解压缩jar来更改它们.

我尝试过使用loader.path,但它似乎没有用.

java -Dloader.path="config/*" -jar myjar-1.0-SNAPSHOT.jar --spring.profiles.active=prod
Run Code Online (Sandbox Code Playgroud)

config目录是在罐子所在的子目录.我正在尝试加载一个密钥库文件,该文件Resource在我的应用程序中注入.src/main/resources中有这样一个文件,但只能在我的IDE中运行,而不是在打包为jar时.所以我想先将一个文件放在类路径上,以便首先在类路径中找到它.

spring-boot

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

枚举中的内部类在Java中是否始终是静态的?

我有一个枚举类,其中包含Java中的内部类.

例如(在实际代码中,在内部使用内部类的枚举上声明了一些方法):

public enum MyEnum{
  VALUE_1,
  VALUE_2;

  private static class MyInnerClass // is static here needed or can it be removed?
  { 
  }
}
Run Code Online (Sandbox Code Playgroud)

PMD告诉我不需要'static'修饰符(违反UnusedModifier规则).这是正确的还是PMD错误?

注意:这个问题不重复,这与我在这里要求的相反.

java enums pmd

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