maven

Geoserver跨域请求设置

孤街浪徒 提交于 2021-02-11 21:36:39
使用OpenLayers请求GeoServer发布的WFS服务时,如果不是相同的域可能会出现如下问题。 已拦截跨源请求:同源策略禁止读取位于 http://localhost:8080/geoserver/weng_test/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=weng_test: dw_country&maxFeatures=50&outputFormat=application%2Fjson 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。 Geoserver 测试版本为 2.12.1。可有以下两种方案。 方案1 (1)下载跨域jar包jetty-servlets.jar 下载geoserver使用的对应jetty版本——可以查看<Geoserver>\lib下jetty-servlet.jar (如,Geoserver 2.12.1 版本下的为 jetty-servlet-9.2.13.v20150730.jar)的版本作为对照。 下载地址: http://central.maven.org/maven2/org/eclipse/jetty/jetty-servlets/ 并将jar包放到<Geoserver>\webapps\geoserver

docker 打包springboot镜像并启动

一世执手 提交于 2021-02-11 21:36:24
1.使用maven将项目打成一个包含所有的jar包 2.pom.xml中包含即可通过mvn clean package 就可以打成可执行jar包 <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <mainClass>com.org.Application</mainClass> <layout>ZIP</layout> </configuration> <executions> <execution> <goals> <goal>repackage</goal

SpringBoot入门(一)——开箱即用

六月ゝ 毕业季﹏ 提交于 2021-02-11 18:55:55
本文来自 网易云社区 Spring Boot是什么 从根本上来讲Spring Boot就是一些库的集合,是一个基于“约定优于配置”的原则,快速搭建应用的框架。本质上依然Spring,在这之上帮我们省去了很多样板化的配置,使得我们能够更专注于应用程序功能的开发。 Spring Boot精要 SpringBoot将很多魔法带入了Spring应用程序的开发之中,其中最重要的是以下四个核心 自动配置:针对常见的应用功能,SpringBoot自动提供相关的配置,减少用于样板化配置的时间 起步依赖:指定基于功能的依赖,用更大粒度的依赖来降低依赖的复杂度 命令行界面:这是SpringBoot的可选特性,借此你只需要写代码就能完成完整的应用程序,无需传统项目构建 Actuator:让你能够深入运行中的SpringBoot应用程序一探究竟 从Spring开始 为了体现SpringBoot的优势,我们先来看看如果使用Spring开发一个简单的Hello World Web应用程序,我们需要做的事情: 一个项目结构,其中有一个包含必要依赖的Maven或者Gradle构件文件,最起码要有Spring MVC和Servlet API这些依赖 一个web.xml文件(或者一个WebApplicationInitializer实现),其中声明了Spring的DispatcherServlet

Failed to collect Maven dependencies in Java HelloWorld when deploying to heroku

倖福魔咒の 提交于 2021-02-11 17:29:43
问题 I'm playing with Java and heroku following the heroku guide. But with few modifications. In this case I use JDK 1.7, Jetty 8.1.2.v20120308 and Maven dependencies plugin 2.7 (Because it seems, 2.4 couldn't be built) All is built ok locally with mvn package but when I use git push heroku master to deploy on heroku, I get this message: [ERROR] Failed to execute goal on project helloart: Could not resolve dep endencies for project main.java:helloart:jar:1.0-SNAPSHOT: Failed to collect dep

Maven Shade with ojdbc Dependency

扶醉桌前 提交于 2021-02-11 16:50:37
问题 I'm trying to develop a Java application that connects to an Oracle database and executes a function. If I run the application in Eclipse it works, but when I try to run the .jar built with Maven Shade an error is thrown "Error encountered: java.sql.SQLException: No suitable driver found". Steps Execute "mvn clean install -U" Execute .jar with "java -jar example-1.0-SNAPSHOT.jar" I can see that the Maven throws some WARNINGS about overlapping resources, could this be the reason? [WARNING]

Maven Shade with ojdbc Dependency

天涯浪子 提交于 2021-02-11 16:48:34
问题 I'm trying to develop a Java application that connects to an Oracle database and executes a function. If I run the application in Eclipse it works, but when I try to run the .jar built with Maven Shade an error is thrown "Error encountered: java.sql.SQLException: No suitable driver found". Steps Execute "mvn clean install -U" Execute .jar with "java -jar example-1.0-SNAPSHOT.jar" I can see that the Maven throws some WARNINGS about overlapping resources, could this be the reason? [WARNING]

How to disable jar creation in commandline in a maven project?

允我心安 提交于 2021-02-11 16:32:05
问题 I have a maven project for which I'm running two separate builds. In one build I want to save the build time by disabling the jar creation of maven modules in it.(There are 45 maven modules). There is a Maven-Jar-Plugin that is being used to create the jars. I want to conditionally disable the jar creation at the command line, that is, looking for something similar to -Dskiptests used to skip the unit tests though there is a surefire plugin by default. 回答1: The maven-jar-plugin does not

How to disable jar creation in commandline in a maven project?

不问归期 提交于 2021-02-11 16:31:22
问题 I have a maven project for which I'm running two separate builds. In one build I want to save the build time by disabling the jar creation of maven modules in it.(There are 45 maven modules). There is a Maven-Jar-Plugin that is being used to create the jars. I want to conditionally disable the jar creation at the command line, that is, looking for something similar to -Dskiptests used to skip the unit tests though there is a surefire plugin by default. 回答1: The maven-jar-plugin does not

JUnit 5 and Mockito

删除回忆录丶 提交于 2021-02-11 15:48:36
问题 With Java 14 and JUnit 5, if I add mockito-junit-jupiter to my build, an error is thrown when trying to run mvn test even without using mockito in any tests. Wiithout mockito-junit-jupiter everything is okay. All dependencies are the latest versions except Maven. The error thrown is # Created at 2020-04-15T16:34:33.816 org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot

How can I make Springboot-annotated classes load properly when they are in a library?

依然范特西╮ 提交于 2021-02-11 15:45:50
问题 I have a working Spring Boot application which includes a class like this: @RestController @Validated @RequestMapping("/HelloWorld") public class HelloWorldController { private static int foo = getFoo (); private static int getFoo () { System.out.println ("HelloWorldController getFoo"); return 0; } public HelloWorldController () { System.out.println ("HelloWorldController Constructor"); } @GetMapping("/get") public HelloWorld root () { return new HelloWorld ("Hello, world!"); } } The /get