o sometimes properties fetched using the ${some.property} notation don't always come through. in particular when I added a maven.webserver.port.http calue to my project.properties and ran the plugin, the plugin failed on the check for maven.webserver.test.socket because the ${maven.webserver.test.socket} notation was used. when I switched to context.getVariable('maven.webserver.test.socket') it found my project.properties specified value no problem. Amazing....
o added maven.appserver properties to the filterset so that the two plugins can integrate better. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113433 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
90ebd3d0d2
commit
078e8cfdfa
@ -187,43 +187,80 @@
|
||||
<ant:property name="maven.webserver.dir.path"
|
||||
location="${maven.webserver.dir}" />
|
||||
|
||||
<!-- convert all path related properties to their os equivalent -->
|
||||
<ant:property name="maven.appserver.home.path"
|
||||
location="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.home')}" />
|
||||
<ant:property name="maven.appserver.conf.dir.path"
|
||||
location="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.conf.dir')}" />
|
||||
<ant:property name="maven.appserver.root.path"
|
||||
location="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.root')}" />
|
||||
<ant:property name="maven.appserver.dir.path"
|
||||
location="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.dir')}" />
|
||||
|
||||
<!-- create the filterset to be available to copy tasks that want it -->
|
||||
<ant:filterset id="maven.webserver.filterset.default">
|
||||
<ant:filter token="maven.webserver.home"
|
||||
value="${maven.webserver.home.path}" />
|
||||
value="${context.getVariable('maven.webserver.home.path')}" />
|
||||
<ant:filter token="maven.webserver.name"
|
||||
value="${maven.webserver.name}" />
|
||||
value="${context.getVariable('maven.webserver.name')}" />
|
||||
<ant:filter token="maven.webserver.version"
|
||||
value="${maven.webserver.version}" />
|
||||
value="${context.getVariable('maven.webserver.version')}" />
|
||||
<ant:filter token="maven.webserver.port.http"
|
||||
value="${maven.webserver.port.http}" />
|
||||
value="${context.getVariable('maven.webserver.port.http')}" />
|
||||
<ant:filter token="maven.webserver.port.https"
|
||||
value="${maven.webserver.port.https}" />
|
||||
value="${context.getVariable('maven.webserver.port.https')}" />
|
||||
<ant:filter token="maven.webserver.port.A"
|
||||
value="${maven.webserver.port.A}" />
|
||||
value="${context.getVariable('maven.webserver.port.A')}" />
|
||||
<ant:filter token="maven.webserver.port.B"
|
||||
value="${maven.webserver.port.B}" />
|
||||
value="${context.getVariable('maven.webserver.port.B')}" />
|
||||
<ant:filter token="maven.webserver.port.C"
|
||||
value="${maven.webserver.port.C}" />
|
||||
value="${context.getVariable('maven.webserver.port.C')}" />
|
||||
<ant:filter token="maven.webserver.conf.dir"
|
||||
value="${maven.webserver.conf.dir.path}" />
|
||||
value="${context.getVariable('maven.webserver.conf.dir.path')}" />
|
||||
<ant:filter token="maven.webserver.host"
|
||||
value="${maven.webserver.host}" />
|
||||
value="${context.getVariable('maven.webserver.host')}" />
|
||||
<ant:filter token="maven.webserver.dir"
|
||||
value="${maven.webserver.dir.path}" />
|
||||
value="${context.getVariable('maven.webserver.dir.path')}" />
|
||||
<ant:filter token="maven.webserver.root"
|
||||
value="${maven.webserver.root.path}" />
|
||||
value="${context.getVariable('maven.webserver.root.path')}" />
|
||||
|
||||
<!-- allow integration with the properties of the appserver plugin -->
|
||||
<ant:filter token="maven.appserver.home"
|
||||
value="${context.getVariable('maven.appserver.home.path')}" />
|
||||
<ant:filter token="maven.appserver.name"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.name')}" />
|
||||
<ant:filter token="maven.appserver.version"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.version')}" />
|
||||
<ant:filter token="maven.appserver.port.http"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.port.http')}" />
|
||||
<ant:filter token="maven.appserver.port.https"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.port.https')}" />
|
||||
<ant:filter token="maven.appserver.port.A"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.port.A')}" />
|
||||
<ant:filter token="maven.appserver.port.B"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.port.B')}" />
|
||||
<ant:filter token="maven.appserver.port.C"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.port.C')}" />
|
||||
<ant:filter token="maven.appserver.conf.dir"
|
||||
value="${context.getVariable('maven.appserver.conf.dir.path')}" />
|
||||
<ant:filter token="maven.appserver.host"
|
||||
value="${pom.getPluginContext('maven-appserver-plugin').getVariable('maven.appserver.host')}" />
|
||||
<ant:filter token="maven.appserver.dir"
|
||||
value="${context.getVariable('maven.appserver.dir.path')}" />
|
||||
<ant:filter token="maven.appserver.root"
|
||||
value="${context.getVariable('maven.appserver.root.path')}" />
|
||||
|
||||
</ant:filterset>
|
||||
|
||||
<!-- a flag to see if the webserver is started -->
|
||||
<j:remove var="maven.webserver.started" />
|
||||
<ant:condition property="maven.webserver.started">
|
||||
<ant:and>
|
||||
<ant:socket server="${maven.webserver.host}"
|
||||
port="${maven.webserver.test.socket}" />
|
||||
<ant:socket server="${context.getVariable('maven.webserver.host')}"
|
||||
port="${context.getVariable('maven.webserver.test.socket')}" />
|
||||
<!-- only use the test url if defined, else just use the socket -->
|
||||
<j:if test="${context.getVariable('maven.webserver.test.url') != null}">
|
||||
<ant:http url="${maven.webserver.test.url}" />
|
||||
<ant:http url="${context.getVariable('maven.webserver.test.url')}" />
|
||||
</j:if>
|
||||
</ant:and>
|
||||
</ant:condition>
|
||||
@ -232,8 +269,8 @@
|
||||
<j:remove var="maven.webserver.installed" />
|
||||
<ant:condition property="maven.webserver.installed">
|
||||
<ant:and>
|
||||
<ant:available file="${maven.webserver.root}" type="dir" />
|
||||
<ant:available file="${maven.webserver.dir}" type="dir" />
|
||||
<ant:available file="${context.getVariable('maven.webserver.root')}" type="dir" />
|
||||
<ant:available file="${context.getVariable('maven.webserver.dir')}" type="dir" />
|
||||
</ant:and>
|
||||
</ant:condition>
|
||||
|
||||
@ -243,14 +280,14 @@
|
||||
|
||||
<j:set var="maven.webserver.installed.msg">
|
||||
<j:choose>
|
||||
<j:when test="${maven.webserver.installed}">installed</j:when>
|
||||
<j:when test="${context.getVariable('maven.webserver.installed')}">installed</j:when>
|
||||
<j:otherwise>not installed</j:otherwise>
|
||||
</j:choose>
|
||||
</j:set>
|
||||
|
||||
<j:set var="maven.webserver.started.msg">
|
||||
<j:choose>
|
||||
<j:when test="${maven.webserver.started}">started</j:when>
|
||||
<j:when test="${context.getVariable('maven.webserver.started')}">started</j:when>
|
||||
<j:otherwise>not started</j:otherwise>
|
||||
</j:choose>
|
||||
</j:set>
|
||||
@ -263,7 +300,7 @@ Maven has determined your <j:expr value="${maven.webserver.fullname}"/> webserve
|
||||
|
||||
<j:if test="${context.getVariable('maven.webserver.test.url') == null}">
|
||||
<log:info trim="false">
|
||||
Maven has determined your <j:expr value="${maven.webserver.fullname}"/> webserver instance is <j:expr value="${maven.webserver.installed.msg}"/> in directory [ <j:expr value="${maven.webserver.dir}"/> ] and <j:expr value="${maven.webserver.started.msg}"/> using socket <j:expr value="${maven.webserver.test.socket}"/> on host <j:expr value="${maven.webserver.host}"/>.
|
||||
Maven has determined your <j:expr value="${context.getVariable('maven.webserver.fullname')}"/> webserver instance is <j:expr value="${context.getVariable('maven.webserver.installed.msg')}"/> in directory [ <j:expr value="${maven.webserver.dir}"/> ] and <j:expr value="${maven.webserver.started.msg}"/> using socket <j:expr value="${maven.webserver.test.socket}"/> on host <j:expr value="${maven.webserver.host}"/>.
|
||||
</log:info>
|
||||
</j:if>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user