小编Cha*_*min的帖子

.gitignore文件未复制到原型JAR - 变通办法?

目前在maven-resources-plugin中存在一个错误,即.gitignore文件未复制到原型JAR.请参阅此错误报告

简短而简单的问题:在原型中获取文件有变通方法吗?

编辑:行家资源插件版本设置为2.6并没有解决我的问题(如提到这里)

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
Run Code Online (Sandbox Code Playgroud)

gitignore maven maven-resources-plugin maven-archetype

17
推荐指数
1
解决办法
2706
查看次数

GWT 2.6.0如何启用Internet Explorer 6/7排列

发行说明GWT 2.6.0:"ie6排列(也处理IE 7)现在默认禁用.在下一个主要的GWT版本中将删除对IE6和IE7的支持." 官方相关说明:http://www.gwtproject.org/release-notes.html#Release_Notes_2_6_0

默认情况下,IE6排列被禁用.但我如何启用ie6排列使我的应用程序与ie6和ie7一起工作?

Secound问题:是module.xml文件启用permuation的唯一方法.什么是gwt编译器的标志?

java gwt internet-explorer gwt-compiler

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

开始挥杆应用程序的最佳实践

启动java swing应用程序的最佳实践方法是什么?也许有另一种方法可以做到这一点.

我想知道我是否必须使用SwingUtilities类来启动应用程序(可能性)(第一种可能性).

public class MyFrame extends JFrame {

public void createAndShowGUI() {
    this.setSize(300, 300);
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    // add components and stuff
    this.setVisible(true);
}

public static void main(String[] args) {

    // First possibility
    MyFrame mf = new MyFrame();
    mf.createAndShowGUI();

    // Secound possibility
    SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
            MyFrame mf = new MyFrame();
            mf.createAndShowGUI();
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

}

java swing swingworker swingutilities

5
推荐指数
1
解决办法
6568
查看次数

如何将 spring boot 参数传递给 tomcat 部署?

我有一个 spring boot 项目,在 pom 文件中说明了打包战争。

<packaging>war</packaging>   
...
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.5.RELEASE</version>
    <relativePath/>
</parent>
Run Code Online (Sandbox Code Playgroud)

使用 maven clean package 命令,我可以构建 war 文件。下一步是启动war文件

java -jar <artifactId>.war --spring.config.name=application-<profile>
Run Code Online (Sandbox Code Playgroud)

重要的是我传递了一个工作正常的参数 (spring.config.name)。但我的问题是如何在 tomcat 环境中部署这场战争时传递这个论点?我把war复制到tomcat的webapps文件夹中。但是我可以在哪里传递提到的论点?

编辑以获得更多说明:我不是通过设置系统变量或其他东西来寻找解决方案。从我的角度来看,一个合适的解决方案是在 Maven 配置文件上进行配置。例如,如果我用

mvn clean package -P<profile>
Run Code Online (Sandbox Code Playgroud)

参数被传递到 spring boot 中的适当位置。

编辑 2:我的 ServletInitializer 扩展自 SpringBootServletInitializer,它扩展自 WebApplicationInitializer

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

public class ServletInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

}
Run Code Online (Sandbox Code Playgroud)

而我的应用程序类:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

    public static …
Run Code Online (Sandbox Code Playgroud)

java tomcat spring-boot

5
推荐指数
1
解决办法
3799
查看次数