maven-2

How to ignore .java files when compiling using maven?

偶尔善良 提交于 2019-12-22 08:13:35
问题 I have .java files in my source directory that don't compile yet due to some API change. I would like to fix sources one by one and it would be useful to ignore some of them to run tests. 回答1: With the maven compiler plugin and the exclude option: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <excludes> <exclude>**/*Point*.java</exclude> </excludes> </configuration> </plugin> </plugins> </build> Resources:

Best ways to manage generated artifacts for web service/xml bindings in a java webapp/client?

為{幸葍}努か 提交于 2019-12-22 08:09:29
问题 I'm working on a couple of web services that use JAXB bindings for the messages (in JAX-WS or spring-ws). When using these bindings there's always some code that is automatically generated from the WSDL to bind the message objects. I'm struggling to figure out the best way I can make this work so that it's easy to work with, hard to break and integrates nicely with IDEs (mostly using eclipse). I think there are a couple of ways to go about this. The three main options I see right now are:

How to create folder for generated sources in Maven?

拥有回忆 提交于 2019-12-22 06:39:21
问题 I have to generate sources using wsimport and i assume that it should go to /target/generated-sources/wsimport rather than /src/main/java. The problem is that wsimport needs target folder created before execution and it fails. Can I create that dir first using any maven plugin. I can do it using ant but i prefer to keep it in POM. 回答1: I have to generate sources using wsimport and i assume that it should go to /target/generated-sources/wsimport rather than /src/main/java. This is a correct

Parent properties inside maven antrun plugin

旧街凉风 提交于 2019-12-22 05:31:15
问题 There is a multi-module project. Inside the child I need to do some complicated stuff (integration test with deploying to application server and so on). So there is an integrationtest child, and from this module I need the root of the parent to reach other modules. I do not want to use "..". There is a property in integrationtest POM: <properties> <main.basedir>${project.parent.basedir}</main.basedir> ... </properties> And there is an antrun plugin with the following content: <plugins>

Eclipse (STS) + Maven

丶灬走出姿态 提交于 2019-12-22 05:29:30
问题 I basically have 2 questions: Is there a way to invoke maven console from eclipse? (where I could write eclipse:eclipse , and it started building eclipse project) Where does STS unpack it's maven? I'd like to add that path to env variables, so that I could use it from my windows console. 回答1: Is there a way to invoke maven console from eclipse? (where I could write eclipse:eclipse, and it started building eclipse project) You could open a shell inside eclipse , cd into the right directory and

Running exec-maven-plugin multiple times in a single phase

天涯浪子 提交于 2019-12-22 04:43:11
问题 I'm trying to test a client/server application, and using Maven to handle the build/test/deploy. To test the application, I need to: run an installer script (to install the server), kick off a startup command (to start the service), run the test (maven-surefire-plugin), stop the service, and uninstall the service. Steps 1,2,4 and 5 will use the maven-exec-plugin. Step 3 will use the maven-surefire-plugin. The problem is that all 5 of these steps will occur in the 'test' phase. Maven allows

Running exec-maven-plugin multiple times in a single phase

被刻印的时光 ゝ 提交于 2019-12-22 04:43:00
问题 I'm trying to test a client/server application, and using Maven to handle the build/test/deploy. To test the application, I need to: run an installer script (to install the server), kick off a startup command (to start the service), run the test (maven-surefire-plugin), stop the service, and uninstall the service. Steps 1,2,4 and 5 will use the maven-exec-plugin. Step 3 will use the maven-surefire-plugin. The problem is that all 5 of these steps will occur in the 'test' phase. Maven allows

Is it possible to single out and run a specific goal bound to a maven phase?

允我心安 提交于 2019-12-22 04:16:19
问题 Updated to (hopefully) clarify : If a goal is defined to run during a given phase, is it possible to run the individual goal without running thru all phases. In other words would it be possible to run the antrun:run goal (which is defined as part of the install phase below) without getting dependencies, generate-resources, compiling, testing, package, etc? I'm using the antrun plugin to create a zip file during the package phase and to delete and copy some files during the install phase. I

List of possible classifiers and types in dependencies

℡╲_俬逩灬. 提交于 2019-12-22 04:14:36
问题 I have searched the net for the all the possible values that you can put in the scope tag inside dependency tag, but I haven't found any list with the same data for the classiffier and the type. Anybody knows what I can and cannot put inside this tags? Just to be clear, I am not asking what does the classifier tag or the type tag do, I just want a list of the data that this tag accepts or where can I find it. Thanks! 回答1: From the Maven Reference: Update Oops, I misunderstood the question.

question on mvn -e clean install

一笑奈何 提交于 2019-12-22 04:12:40
问题 In maven, what does "-e" stands for in the following command. mvn -e clean install Moreover, what is the difference between mvn clean install and mvn clean compile 回答1: As Satish stated, the "-e" switch will display execution errors in the maven output. As to the difference in "install" vs "compile", those are different Maven lifecycle stages. See the Introduction to the Build Lifecycle documentation for help with that. The key to remember is that Maven will execute all lifecycle stages up to