maven

wsdl2java generated code causes character encoding problems

ぐ巨炮叔叔 提交于 2021-02-10 05:57:06
问题 I have generated a bunch of java-files from a WSDL source. I used Apache CXF 2.6.1 for generating the files. When I put the code onto our production box that is running jetty and maven and I send a request to the server via the generated java-files it somehow changes the systems/JVM character encoding. The swedish characters å, ä and ö changes into Ã¥, ä, ö. I can't reproduce this on my own box. Someone have any idea? 回答1: Since version 2.5.4 there is a new command line option -encoding

How to change maven home directory?

北慕城南 提交于 2021-02-10 05:52:12
问题 I have maven home directory as below, [root@localhost configuration-simple]# su -c "vi /etc/profile.d/maven.sh" [root@localhost configuration-simple]# mvn -version Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530) Maven home: /home/kartyk/NetBeansProjects/motown.io/motown-develop/apache-maven-3.0.5 Java version: 1.7.0_51, vendor: Oracle Corporation Java home: /usr/java/jdk1.7.0_51/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux",

Running Specific TestNG Groups from Maven

自作多情 提交于 2021-02-10 05:17:10
问题 I have 2 groups of test cases as mentioend below. @Test(groups="one", dataProvider = "TestData") public void firstTest(String data){ //Code } @Test(groups="one", dataProvider = "TestData") public void secondTest(String data){ //Code } @Test(groups="two", dataProvider = "TestData") public void thirdTest(String data){ //Code } Below is the XML file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Test-Automation" parallel="methods"

Running Specific TestNG Groups from Maven

陌路散爱 提交于 2021-02-10 05:17:01
问题 I have 2 groups of test cases as mentioend below. @Test(groups="one", dataProvider = "TestData") public void firstTest(String data){ //Code } @Test(groups="one", dataProvider = "TestData") public void secondTest(String data){ //Code } @Test(groups="two", dataProvider = "TestData") public void thirdTest(String data){ //Code } Below is the XML file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Test-Automation" parallel="methods"

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation

北慕城南 提交于 2021-02-10 05:15:28
问题 Using maven to add activemq, there is a problem about conflicting jar when I unit-test in IDE, the exception message is: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation i have excluded the validation from javaee, as following: <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>javax.validation</groupId>

Launch spring-boot app before Gatling simulation

流过昼夜 提交于 2021-02-10 04:57:47
问题 I have a spring-boot project powered by maven I would like to run load tests on, using Gatling. At this moment, I can run my simulation typing the following command : mvn gatling:execute It works correctly but I have to launch my springboot app manually or it won't work. Here is my Simulation class : package main.aperture.gatling import aperture.config.SpringBootApertureTestingConfiguration import io.gatling.core.Predef._ import io.gatling.core.structure.ScenarioBuilder import io.gatling.http

Gradle changing dependencies by classifier

青春壹個敷衍的年華 提交于 2021-02-10 04:54:46
问题 Hello I got Maven file like so <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>${zookeeper.version}</version> <exclusions> <!-- Dependency on log4j will be removed in subsequent versions see https://issues.apache.org/jira/browse/ZOOKEEPER-850 --> <exclusion> <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> <exclusion> <artifactId>log4j</artifactId> <groupId>log4j</groupId> </exclusion> </exclusions> </dependency>

Java 简单操作hdfs API

六月ゝ 毕业季﹏ 提交于 2021-02-10 04:39:37
注:图片如果损坏,点击文章链接: https://www.toutiao.com/i6632047118376780295/ 启动Hadoop出现问题:datanode的clusterID 和 namenode的clusterID 不匹配 从日志中可以看出,原因是因为datanode的clusterID 和 namenode的clusterID 不匹配。 打开hdfs-site.xml里配置的datanode和namenode对应的目录,分别打开current文件夹里的VERSION,可以看到clusterID项正如日志里记录的一样,确实不一致,修改datanode里VERSION文件的clusterID 与namenode里的一致,再重新启动dfs(执行start-dfs.sh)再执行jps命令可以看到datanode已正常启动。 出现该问题的原因:在第一次格式化dfs后,启动并使用了hadoop,后来又重新执行了格式化命令(hdfs namenode -format),这时namenode的clusterID会重新生成,而datanode的clusterID 保持不变。 验证伪分布环境是否完成 Java操作hdfs 新创建一个maven项目 编写pom文件 编写测试代码 我们运行一下看一看 这种简单的写法是本地模式,所以我们去看下本地文件是不是有了

eureka server 单节点与多节点部署演示

邮差的信 提交于 2021-02-09 20:01:17
环境搭建 目录结构(ad-eureka为子模块)   --ad-spring-cloud    --ad-eureka      --pom.xml    --pom.xml 主pom.xml    <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <modules> <module

NoSuchMethodError idea解决jar包冲突

[亡魂溺海] 提交于 2021-02-09 16:04:31
报 NoSuchMethodError (使用 spring boot 框架 idea) 一般是 jar 包冲突 Exception in thread"main" java.lang.NoSuchMethodError:org.springframework.http.MediaType.getCharset()Ljava/nio/charset/Charset; maven 工程,一个 artifact 的 jar 包可能不只一处被依赖;有时候依赖会出现相同的 artifact 却不同版本,相互存在冲突,这时就需要 exclude 某个版本。 试了在命令行工程目录下执行 mvn dependency:tree 可以出来文本的依赖关系,但是不会把一个 artifact 的每处依赖都显示出来,只会出现第一次被依赖的地方 , 而且还会先下载包 , 非常慢 。 Idea 有个 Maven Projects 窗口,一般在右侧能够找到,如果没有可以从菜单栏打开: View>Tool Windows>Maven Projects; 选择要分析的 maven module(idea 的 module 相当于 eclipse 的 project), 右击 show dependencies, 会出来该 module 的全部依赖关系图,非常清晰细致。 选红色线的包右键 exclude 即可 来源: