maven-2

deploy maven war file to tomcat from IntelliJ

为君一笑 提交于 2019-12-12 12:06:44
问题 I have a maven war project. How can I do do the following from within IntelliJ IDEA: create .war file deploy it to a local Tomcat start Tomcat in debug mode 回答1: You need to configure maven-war-plugin to build your war. tomcat<x>-maven-plugin will allow you to deploy it to a tomcat instance and may in fact do the war generation too - I use JBoss at my current office so haven't got any experience with the maven tomcat integration. see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/ and

Maven2 Eclipse integration

橙三吉。 提交于 2019-12-12 11:35:20
问题 There seem to be two rival Eclipse plugins for integrating with Maven: m2Eclipse and q4e. Has anyone recently evaluated or used these plugins? Why would I choose one or the other? 回答1: Side by side comparison table of three maven plugins. 回答2: There is only one point where q4e is actually better: dependency viewer. You could see the dependency tree, manage your dependencies visually and even see them in a graph. But, m2eclipse works in a better way, specially because you can create you own

How to filter ressources during build in Eclipse project?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 10:54:15
问题 I have an application that uses several configuration files (let just consider appli.properties here). These files contain several values that depend on the environment. We can find some information such as: server.port=${envi.server.port} On other side, I have a set of properties files, one per environment (dev.properties, homolo.properties, etc.). They contain the values for some properties in configuration files. We can find here this kind of properties: envi.server.port=4242 My build is

Excluding packages from jars in maven assembly descriptor

好久不见. 提交于 2019-12-12 10:39:34
问题 I have the following syntax problem. I have a jar file that is created from other unpacked jar files. I am trying to exclude some package from being in the the new jar file. Here is my assembly descriptor <assembly> <id>gs-jar</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <unpack>true</unpack> <scope>runtime</scope> <includes> <include>com.delver:shci-commons</include> <include>com.delver:shci-model</include>

Maven 2 Not Running Junit 4 Tests

拟墨画扇 提交于 2019-12-12 10:38:24
问题 I'm having an issue getting surefire to run Junit4 tests. This same issue was reported in https://stackoverflow.com/questions/2021771?sort=newest#sort-top but the solution there was to removed the offending dependency whose transitive dependency caused the inclusion of junit3. In my case the dependency is necessary. I'm trying to figure out how to exclude transitive dependencies to junit3 so it is not included in the surefire:test classpath. Below are my pom.xml and the output from "mvn -X

Maven profiles and install

南笙酒味 提交于 2019-12-12 10:08:56
问题 If I have Maven builds set up for an app with profiles set up for different environments (say like prod vs. dev, defining different DB settings and stuff like that) the 'install' goal doesn't seem to make sense, as I don't know which environment got installed into my repo - I've just got com.example.myproject:myapp:0.0.1. Have I misunderstood something, or are profiles supposed to be used with other goals? 回答1: Well, you could use the classifier attribute so that each profile creates a jar

Maven: clean the webapp directory before war:exploded?

依然范特西╮ 提交于 2019-12-12 09:41:00
问题 quoting from maven war plugin usage page : <project> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory> </configuration> </plugin> </plugins> </build> ... </project> How do i clean the content of the directory defined in the <webappDirectory>/sample/servlet/container/deploy/directory</webappDirectory> before

Execute Ant task with Maven

旧巷老猫 提交于 2019-12-12 08:53:40
问题 I'm trying to execute with Maven some test written using Ant tasks. I generated the files required to import the task into Maven, but I can't execute them. My POM is defined this way: <build> <plugins> <plugin> <artifactId>maven-ant-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>generate-sources</phase> <configuration> <tasks> <echo message="Hello, maven"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> <

Maven does not replace a variable in 'settings.xml' when it is invoked

流过昼夜 提交于 2019-12-12 08:47:09
问题 I have defined a local mirror for all repositories in the settings.xml file: <mirror> <id>myMirror</id> <mirrorOf>*</mirrorOf> <url>file://${mypath}/maven/.m2/repository</url> </mirror> I want that my mirror to point to a local path, in this case the path is: file://${mypath}/maven/.m2/repository Where ${mypath} is a variable that I pass when I invoke Maven: mvn -Dmypath="/D:/test" package The problem is that Maven does not replace the variable when it is invoked. I can see that this error is

Importing an existing maven Project into Eclipse

回眸只為那壹抹淺笑 提交于 2019-12-12 08:39:39
问题 I have an existing Maven Project with me . I am using Eclipse Helios as my IDE , i need to import an existing maven Project into my IDE . Please tell me what is the correct approach to import an exisiting maven Application ?? (Should we choose Import Existing maven Project option or Should we choose import Exisiting Projects into Workspace option ?? Please let me know , thank you very much . 回答1: Use Import->Maven->Existing Maven Projects I'm assuming, you've m2eclipse plugin installed in