-
1 votesanswersviews
在Kubernetes上部署Lagom微服务
我正在尝试通过跟踪Chirper Lagom示例在Kubernetes上部署Lagom微服务 . 所以根据提供的指南link,我通过安装Minikube配置了一个kubernetes集群,一切都很好 . 但是当我尝试使用fabric8的docker-maven-plugin构建Chirper Docker图像时,我收到了这个错误: [错误]无法执行目标io.fabric8:docker-mave... -
0 votesanswersviews
无法在spring maven tomcat中使用配置文件启动
我需要使用带 spring 的型材 . 我使用本地Tomcat . 有maven项目,所以,在pom.xml中我添加了: <profiles> <profile> <id>dev</id> <activation> <property&g... -
16 votesanswersviews
Spring引导嵌入式容器或war文件在外部容器中进行 生产环境
我完全能够在两种情况下配置spring boot,这里的问题是哪些更强大并且更推荐,因为我没有在spring boot文档中找到在 生产环境 环境中部署它的推荐方法,我对使用嵌入式容器的担忧是: 如果我想将其设置为Windows或Linux服务,那么jar文件是最佳选择吗? 如果我使用jar文件,我将无法重新启动服务器 . 也许将来我需要在同一个容器中使用更多应用程序 . 如果我重... -
4 votesanswersviews
如何在tomcat 7中为spring boot 1.2.3制作可部署的war文件
构建Spring boot应用程序所需的配置是可部署的战争,可以部署在运行于java 8的tomcat 7中 . 经过几个小时的调试后,我能够获得war文件,但是一旦部署到tomcat,它就没有被正确部署,并且api无法访问并且出现404错误 . catalina日志文件如下: INFO: Deploying web application archive /var/lib/tomcat7/web... -
3 votesanswersviews
Spring MVC有两种配置吗?
我创建了一个基于maven的简单spring-web-mvc项目 . 该示例包含两个配置文件 . 一个在src / main / resources / spring / application-config.xml中,另一个在src / main / webapp / WEB-INF / mvc-config.xml中 该配置是否正常?我认为只是配置拆分mvc-config.xml和applic... -
0 votesanswersviews
Spring boot:不打开jsp文件
我正在开发简单的Spring Boot MVC应用程序 . 虽然我已经阅读了很多答案,所以我仍然无法修复Spring Boot没有找到我的.jsp文件 - 它显示whitelabel错误页面 . 项目结构: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/... -
0 votesanswersviews
Spring Boot服务.jsp <jar>
试着把我的头包裹在Spring Boot周围,我不能让jsp页面显示出来 . 有daos等工作所以没有probs那里,但我不能为我的生活使它显示一个简单的jsp页面(没有数据传入,只是一个简单的页面) 已经阅读了很多关于jsp限制的内容,但并没有真正理解如何绕过它们 . 如果有人可以帮忙解决我在这里失踪的问题 . pom.xml : <?xml version="1.0"... -
4 votesanswersviews
maven多模块项目:是否需要相对路径?
我正在尝试将一组不相交的maven项目链接到一个标准的多模块项目中 . 有趣的是,模块目前没有安排在自然的层次结构中 . 如果我与父pom链接在一起,那么在我将 relativePaths 添加到子pom XML文件中的父节之前,反应器将不会启动 . 如果父版本与子版本中的GAV详细信息正确,并且子模块全部链接在父pom中 - 这不应该足够吗? 简单来说 - 对于非标准目录结构,多模块maven项... -
6 votesanswersviews
带有Spring Boot的多模块maven
我想知道如何使用Spring Boot创建一个带有maven的多模块项目 . 有人能告诉我一个“父母和朋友”的例子吗? 谢谢 -
1 votesanswersviews
spring-boot:运行多模块maven项目
我有Eureka Server的微服务设置和Eureka客户端的多个spring-boot应用程序 . 这是在父(根)级别设置为maven多模块项目 . 以下是层次结构: parent (multi-module parent pom.xml) |_ eureka-server-spring-boot-app (individual pom.xml) |_ eureka-client-sp... -
5 votesanswersviews
带 spring 靴的多模块项目
我正在用 spring-boot 创建一个项目 . Spring启动maven结构要求它具有定义为 spring-boot-starter-parent 的父级 . 我有一种情况,我想将我的应用程序打包为一个多模块结构,我在其中定义包含与地理相关的功能的模块 . 像这样的东西,每个模块都有一个 jar 包装, parent Pom | |-----------Core module | |----... -
1 votesanswersviews
Jar包装在Spring靴子里
我正在创建一个Spring Boot多模块项目 . 模块A依赖于模块B .. 当我以爆炸形式运行时,模块A运行正常 . mvn spring-boot:run 但我无法将jar与依赖项打包在一起,以便我可以执行它 java -jar Module-A.jar 模块一个pom.xml如下: <parent> <artifactId>Module-Test</... -
0 votesanswersviews
Spring-boot-maven-plugin会生成一个有缺陷的清单
我正在经历一种行为,即 spring-boot-maven-plugin 的这种配置: <build> <pluginManagement> <plugins> <plugin> <groupId>org.springframe... -
2 votesanswersviews
spring boot运行时不从父/聚合器模块加载静态资源
我已经在下面的问题上挣扎了大约一个星期,我找不到有同样问题的人 . 我有一个Maven项目,它由几个子模块构成,如下所示: parent-module child A (common library) child B (spring boot application - no static content) child C (spring boot application - s... -
8 votesanswersviews
Spring Boot Maven插件包含资源
示例 是否有可能以某种方式配置spring boot maven插件以包含来自依赖项的资源 . 例如 . 如果在我的 Spring 季启动项目中,我有: <dependency> <groupId>co.company</groupId> <artifactId>example</artifactId> ... -
7 votesanswersviews
spring-boot-maven-plugin不会创建胖 jar
我正在使用 spring-boot-maven-plugin 打包我的REST服务 . 我正在使用 mvn clean install 或 mvn clean package 构建jar . 在我反编译jar之后,我没有发现添加任何依赖项(我希望它是一个包含所有依赖项的胖jar) <plugin> <groupId>org.springframework.boot... -
0 votesanswersviews
使用spring boot maven插件生成胖 jar 时排除外部jar
我使用spring初始化程序创建了一个spring boot应用程序 . 我使用IDE在我的类路径中添加了一些外部jar . 当我尝试创建一个jar,通过maven clean和maven install,我得到了 package com.art.common.exception does not exist. 我们是否需要在pom.xml中添加jar依赖XML? 我不希望我的外部jar成为我的... -
1 votesanswersviews
在大多数基本示例中,无法使用@PersistenceContext注入EntityManager
要使用PersistenceContext注入实体管理器来测试JPA,我有一个基本的示例项目,其结构如下:Person实体: @Entity public class Person { @Id @GeneratedValue private long id; private String name; private String surname; ... -
8 votesanswersviews
Spring Boot多模块Maven项目@Autowired不起作用
这真的很奇怪 . 我开始将Spring Boot项目作为一个单独的maven项目开始,并且完美无缺 . 基本上它是一个带有安全性和邮件的Spring MVC应用程序 . 然后,当我看到一些组件(如服务,存储库,模型)将被独立应用程序重用时,我决定将maven项目拆分为子模块 . 突然没有自动装配开始工作 . 经过一番调查后,我发现我需要将这些软件包明确地放在我的独立应用程序的应用程序中: @Com... -
2 votesanswersviews
在spring boot中进行mongodb审计以保存createdDate,lastModifiedDate,createdBy,lastModifiedBy
我使用的是spring boot,因此我没有使用任何xml文件进行配置 . 我要做的是EnableMongoAuditing保存createdDate,lastModifiedDate等,同时使用MongoRepositories保存数据 . 我的模特课 @Component @Document(collection = "CAPPING") public class Temp... -
3 votesanswersviews
“错误:在尝试执行Maven生成的Jar时无法找到或加载主类com.mycompany.App”
我正在尝试在Windows7上构建一个maven java程序,我的java -version是1.7 . 我收到这个错误: “错误:在尝试执行Maven生成的Jar时无法找到或加载主类com.mycompany.App” 即使Jar内存在 com/mycompany/App.class ,它也有一个主方法 . 这是我的 META-INF/MANIFEST.MF 的样子: Manifest-V... -
7 votesanswersviews
在为spring boot应用程序生成war包时,maven build失败了吗?
这是我在SO上的上一个问题here的扩展 . 根据这篇文章,主要方法不需要生成 deployable war 我正在尝试为这个简单的uploading files应用程序生成 deployable war . 源代码可以为此示例应用程序找到here . 按照 spring 启动的说明进行jar到war的转换,我更改了 pom.xml 以反映以下内容 . (刚刚添加 tomcat 依赖与范围 p... -
0 votesanswersviews
java.lang.ClassNotFoundException:org.springFramework.web.context.ContextLoaderListener tomcat 9,maven,spring [复制]
这个问题在这里已有答案: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 30个答案 我的网络项目突然停止工作 . 我已经尝试了一切,将maven依赖项添加到类路径,删除spring-web.jar并添加回来,删除tomcat并添加回来等等 . 请帮助我,我不知道如何... -
0 votesanswersviews
如何创建可部署的springboot战争
我正在尝试创建一个部署在Tomcat中的maven spring boot应用程序 . 我遵循Spring文档和其他stackoverflow建议中的建议 - war,Application.java扩展SpringBootServletInitializer,从构建插件中删除spring-boot-maven-plugin等 . 生成war文件并部署在tomcat中 . 但我发现所有静态文件都... -
3 votesanswersviews
Spring引导排除属性文件并在执行时将其提供给jar
我有多组属性文件smtp,db,src / main / resources目录下的常用设置,我的项目是maven项目jar包 . 我想从jar构建中排除所有这些属性文件,并将所有这些属性文件放在target / conf文件夹中 . 现在我想在执行应用程序jar时将所有这些配置文件提供给我的jar . 怎么做到这一点?我在pom.xml文件中做了很多事情以排除所有这些属性,现在无法将它们提供给生... -
0 votesanswersviews
使用执行重新打包和外部application.yml属性运行jar启动应用程序
我使用以下插件来获取Spring Boot应用程序的可执行jar: <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactI... -
3 votesanswersviews
在使用spring-boot-maven-plugin创建的嵌套可执行jar中启动主类
我有一个简单的Spring Boot类,如下所示: @SpringBootApplication public class Starter { public static void main(String... args) { if ("foo".equals(args[0])) { SpringApplication.r... -
0 votesanswersviews
如何在Spring Boot App中使用Tomcat Embedded在运行时加载外部战争文件
我正在尝试使用嵌入式Tomcat服务器的Spring Boot jar来在运行时加载外部战争 . 我正在尝试使用此post中显示的技术执行此操作 . Spring Boot应用程序中的容器bean: @Bean public EmbeddedServletContainerFactory servletContainerFactory() { return new TomcatEmbedd... -
0 votesanswersviews
tomcat7 - 如何部署spring boot war文件
我重新创建一个spring boot简单项目“greetings”,当我运行它在服务器上时,它工作,我在浏览器中获取JSON数据,如下所示: 本地主机:9090 / API /问候 它显示: [{“id”:1,“text”:“Hello world1”},{“id”:2,“text”:“Hello world2”}] 并通过控制台成功生成war文件: ... \ workspace-sts-3.... -
23 votesanswersviews
如何在tomcat服务器上部署spring boot Web应用程序
我已经创建了spring boot web应用程序,但我无法在tomcat上部署spring boot web应用程序WAR文件,我可以将其作为java应用程序运行 . 如何在tomcat上将spring boot应用程序作为Web服务运行 . 我正在使用以下代码 . 如果可以在tomcat上运行,请在不使用web.xml和使用web.xml的情况下帮助我使用注释 . @SpringBootApp...