Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Customizing Maven > 2.4. Defining a preGoal

Defining a preGoal

Since you would like to incorporate the generated SOAP client into your own project, you need to use the Maven Axis plug-in. When the Axis plug-in generates source, your build needs to make sure that the source it generates is included in your project’s compilation. To accomplish this, you need to define a preGoal and postGoal on the java:compile goal.

How do I do that?

The Axis plug-in generates source files and places them in maven.axis.generated.dir, which defaults to target/axis/src. While you don’t want to copy the generated source files to your project by copying them to src/main/java, you do want these files to be included in your project’s artifact. You need to execute the axis:compile goal before you execute the java:compile goal, as axis:compile will add the source generated by axis:wsdl2java to the compilation source path. The following maven.xml file uses a preGoal which executes another goal before java:compile:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint