Java Reference
In-Depth Information
</plugin>
//...
Of course, to use the plug-in, you need to be able to reach the Maven 2 repository that stores
it. This is located at http://download.java.net/maven/2/ . Adding this to your organization's in-
ternal Maven repository (for example, Archiva) will allow the repository to act as a proxy and
will simplify the process of managing plug-ins across developers or teams.
To use an internal repository, you must specify it in your settings.xmlfile, typically located in
your user home. If your organization doesn't have an internal repository, that's fine—you can
just skip this part:
<mirrors>
<mirror>
<id>my-internal</id>
<mirrorOf>*</mirrorOf>
<url>http://repo.example.com/archiva/repository/internal</url>
<name>My - Archiva</name>
</mirror>
</mirrors>
Using a variable for the WSDL location
In this example, you run the wsimport goal of the plug-in using a variable as the WSDL URL.
The variable exists in order to account for a variety of WSDL locations that your environ-
ment may require. For example, if you're using a development workstation and running a loc-
al server, your WSDL may be located at localhost. Once it's time to promote your work to
an integration build server, your WSDL may need to use a different address. This problem is
solved by using variables in your Maven profile.
To follow this example, you might have a developer profile and an integration server profile,
each of which is activated depending on different variables in the environment.
To set this up, create a profiles.xmlfile within the root folder of your project. Here you
define a variable matching the name of the variable used within the POM for the value of the
wsdlUrl . The text within the variable name element is used as the value at build time, so your
http://localhost:8080/myProject/SomeService?wsdl value will be inserted as the URL
for the wsimport plug-in to use:
<profilesXml 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/profiles-1.0.0.xsd">
<profiles>
<profile>
<id>development</id>
Search WWH ::




Custom Search