pom.xml

Starting of the Apache tomcat server before integration test

故事扮演 提交于 2021-02-18 12:38:28
问题 I've been looking for an solution for the last 4 days and raised this question as a bounty but still not getting my answer. Where i've succeeded with the help pf pom.xml file:- a) Starting the tomcat server manually using command i.e mvn tomcat7:run. This command also help me deploying of my war file to tomcat server and starting the server. b) Running my integration tests using testng.xml file configuration on eclipse. Where i'm failed with the help pf pom.xml file:- a) Automatically

Maven profiles in pom

老子叫甜甜 提交于 2021-02-11 18:24:40
问题 I am trying to set some system environment variables through maven, based on profiles. So my pom code is <profile> <id>dev</id> <activation> <property> <name>com.xxx.profile</name> <value>dev</value> </property> </activation> <properties> <db-url>jdbc:postgresql://abc</db-url> <db-username>xxx</db-username> <db-pwd>yy</db-pwd> </properties> </profile> So when I build the project, I do mvn clean install -Dcom.xxx.profile=dev In the code, I have String urlDB = System.getProperty("db-url");

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

java.lang.NoSuchMethodError: org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequestBuilder.setSource

…衆ロ難τιáo~ 提交于 2021-02-11 15:15:23
问题 I am trying to run the spring boot parent project which uses child project, which in turn uses project(ES project) which has elasticsearch dependencies and elasticsearch config bean for transport client. The child project uses Spring Data ES repositories, which are enabled by a respective annotation in a project. These are config annotations used in the child: @Configuration @ComponentScan("package") @EntityScan("package3") @EnableJpaRepositories("package2") // enables only es repos for

An attempt was made to call a method that does not exist. STS

假装没事ソ 提交于 2021-02-11 14:44:11
问题 When i run the STS(SpringBoot) application i get the below error: The attempt was made from the following location: org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1321) The following method did not exist: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; The method's class, javax.servlet.ServletContext, is available from the following locations: jar:file:/home/talha/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!

Cobertura code coverage is 0% when using Maven 3

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 13:15:57
问题 After reading this: What is the proper way to use Cobertura with Maven 3.0.2 and this: http://www.wakaleo.com/blog/292-site-generation-in-maven-3 my POM file looks like this: <build> <plugins> ..... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.0</version> <configuration> <reportPlugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> </plugin> <plugin>

Surefire run certain tests in sequence, others in parallel

只愿长相守 提交于 2021-02-07 09:10:43
问题 Is there a way to make certain tests run in in sequence with the surefire plugin for JUnit? Currently it is running all tests in parallel, but some tests are very hard to convert and it would be sufficient if they didn't run in parallel. Here is a part of our pom.xml: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <dependencies> <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-junit47<

Generate jar file in Maven with dependencies and tests

五迷三道 提交于 2021-02-07 05:23:27
问题 I use this code in pom.xml to create a jar file. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <excludes> <exclude>**/log4j.properties</exclude> </excludes> <archive> <manifest> <mainClass>test.LeanFTest</mainClass> </manifest> </archive> </configuration> </plugin> I got error message: Deployment failed: repository element was not specified in the POM inside distribution UPDATE: I added another plugin in pom.xml. <plugin>

Generate jar file in Maven with dependencies and tests

匆匆过客 提交于 2021-02-07 05:23:16
问题 I use this code in pom.xml to create a jar file. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <excludes> <exclude>**/log4j.properties</exclude> </excludes> <archive> <manifest> <mainClass>test.LeanFTest</mainClass> </manifest> </archive> </configuration> </plugin> I got error message: Deployment failed: repository element was not specified in the POM inside distribution UPDATE: I added another plugin in pom.xml. <plugin>