If you want to automate the configuration and deployment task on WebSphere Portal, eventually, you will use XmlAccess.
IBM provides ant task called XmlAccess. My goal is to achieve the invokation of configuration tasks on remote machine from my machine. I use Windows 7 and ant 1.8.4 . Remote installations of WebSphere Portal use Linux.
This blog is a collection of minds around linux, java, javascript, etc. Looking for great opportunities.
Показаны сообщения с ярлыком ant. Показать все сообщения
Показаны сообщения с ярлыком ant. Показать все сообщения
вторник, 28 января 2014 г.
среда, 17 июля 2013 г.
Apache Ivy. My experience.
I've been using Apache Ant for a long time. It is easy to use. But the most feature it lacks is a project dependency management. Moreover, I need not just resolve the open source projects, but to resolve my own projects.
In my development I have 2 projects that share common classes, which are in a third project. I also have a continues integration server. All projects are build on it and later deployed.
I found that Apache Ivy best suites my need. The reasons for this are:
What I like is that in default configuration Ivy offers you a local repository. All you have to do is write an ivy.xml file, which describes your project and dependencies and modify build.xml.
In my situation I write the ivy.xml, that describes the shared project like this:
<ivy-module version="2.0">
<info organisation="my" module="common"/>
<publications>
<artifact name="common" type="jar" />
</publications>
</ivy-module>
And modified build.xml to publish project like this:
<!-- =================================
target: publish-local
================================= -->
<target name="publish-local" depends="jar" description="--> publish this project in the local ivy repository">
<tstamp>
<format property="now" pattern="yyyyMMddHHmmss" />
</tstamp>
<ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]" resolver="local" pubrevision="${version}" pubdate="${now}" forcedeliver="true" />
<echo message="project ${ant.project.name} published locally with version ${version}" />
<ivy:cleancache />
</target>
In my other projects which depends on a "common.jar" I write the following ivy.xml:
<ivy-module version="2.0">
<info organisation="my" module="booking"/>
<dependencies>
<dependency name="common" rev="latest.integration" />
</dependencies>
</ivy-module>
And modified the build.xml like this:
<!-- =================================
target: resolve
================================= -->
<target name="resolve" depends="clean, clean-cache">
<ivy:retrieve />
</target>
That is all.
One more thing. You can use Ivy in Eclipse. For this one can download plugin IvyDE.
In my development I have 2 projects that share common classes, which are in a third project. I also have a continues integration server. All projects are build on it and later deployed.
I found that Apache Ivy best suites my need. The reasons for this are:
- it does integrate with Ant.
- it takes minimum intervention into the project to use Ivy.
- it has tutorials and good documentation.
What I like is that in default configuration Ivy offers you a local repository. All you have to do is write an ivy.xml file, which describes your project and dependencies and modify build.xml.
In my situation I write the ivy.xml, that describes the shared project like this:
<ivy-module version="2.0">
<info organisation="my" module="common"/>
<publications>
<artifact name="common" type="jar" />
</publications>
</ivy-module>
And modified build.xml to publish project like this:
<!-- =================================
target: publish-local
================================= -->
<target name="publish-local" depends="jar" description="--> publish this project in the local ivy repository">
<tstamp>
<format property="now" pattern="yyyyMMddHHmmss" />
</tstamp>
<ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]" resolver="local" pubrevision="${version}" pubdate="${now}" forcedeliver="true" />
<echo message="project ${ant.project.name} published locally with version ${version}" />
<ivy:cleancache />
</target>
In my other projects which depends on a "common.jar" I write the following ivy.xml:
<ivy-module version="2.0">
<info organisation="my" module="booking"/>
<dependencies>
<dependency name="common" rev="latest.integration" />
</dependencies>
</ivy-module>
And modified the build.xml like this:
<!-- =================================
target: resolve
================================= -->
<target name="resolve" depends="clean, clean-cache">
<ivy:retrieve />
</target>
That is all.
One more thing. You can use Ivy in Eclipse. For this one can download plugin IvyDE.
вторник, 9 апреля 2013 г.
Manipulate XML with Ant
суббота, 22 сентября 2012 г.
Установка приложений на Tomcat с помощью ant.
При разработке приложения для работы на Tomcat очень удобной возможностью является установка приложения на Tomcat с помошью скрипта ant.
Удобство заключается в небольшом количестве действий, которое необходимо для установки приложения.
Установку можно выполнить на любой сервер, локальный или удалённый.
Почитать об этом можно в руководстве на Tomcat, но для удобства опишу основные моменты здесь:
1) Необходимо скопировать файл server/lib/catalina-ant.jar из Tomcat в каталог с библиотеками ant ($ANT_HOME/lib).
2) В Tomcat прописать учётную запись для пользователя manager-script.
3) В ant скрипте необходимо объявить задачи tomcat и параметры установки приложения:
<!-- Configure the directory into which the web application is built -->
<property name="build" value="dist"/>
<!-- Configure the context path for this application -->
<property name="path" value="/test"/>
<!-- Configure properties to access the Manager application -->
<property name="url" value="http://localhost:8080/manager"/>
<property name="username" value="duglas"/>
<property name="password" value="password"/>
<!-- Configure the custom Ant tasks for the Manager application -->
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<target name="deploy" description="Install web application"
depends="war">
<deploy url="${url}" username="${username}" password="${password}"
path="${path}" war="file:${build}/springwstest.war"/>
</target>
<target name="undeploy" description="Remove web application">
<undeploy url="${url}" username="${username}" password="${password}"
path="${path}"/>
</target>
4) После этого можно вызывать нужную цель, и приложение будет установлено на сервере. Вызов цели undeploy влечёт за собой удаление приложение на сервере.
Удобство заключается в небольшом количестве действий, которое необходимо для установки приложения.
Установку можно выполнить на любой сервер, локальный или удалённый.
Почитать об этом можно в руководстве на Tomcat, но для удобства опишу основные моменты здесь:
1) Необходимо скопировать файл server/lib/catalina-ant.jar из Tomcat в каталог с библиотеками ant ($ANT_HOME/lib).
2) В Tomcat прописать учётную запись для пользователя manager-script.
3) В ant скрипте необходимо объявить задачи tomcat и параметры установки приложения:
<!-- Configure the directory into which the web application is built -->
<property name="build" value="dist"/>
<!-- Configure the context path for this application -->
<property name="path" value="/test"/>
<!-- Configure properties to access the Manager application -->
<property name="url" value="http://localhost:8080/manager"/>
<property name="username" value="duglas"/>
<property name="password" value="password"/>
<!-- Configure the custom Ant tasks for the Manager application -->
<taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" />
<taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask"/>
<target name="deploy" description="Install web application"
depends="war">
<deploy url="${url}" username="${username}" password="${password}"
path="${path}" war="file:${build}/springwstest.war"/>
</target>
<target name="undeploy" description="Remove web application">
<undeploy url="${url}" username="${username}" password="${password}"
path="${path}"/>
</target>
4) После этого можно вызывать нужную цель, и приложение будет установлено на сервере. Вызов цели undeploy влечёт за собой удаление приложение на сервере.
вторник, 21 августа 2012 г.
Apache cxf 2.6.1 и Eclipse (part 2)
В этой части я решил избавиться от зависимости в виде Eclipse и научиться генерировать веб-сервис с помощью CXF.
суббота, 18 августа 2012 г.
Apache cxf 2.6.1 и Eclipse
В этой заметке мы опишем, как можно с помощью ant в Eclipse создавать веб сервис apache cxf.
понедельник, 13 августа 2012 г.
Ant. Первое знакомство.
Функции Ant:
1) компиляция
2) junit тесты
3) junit отчёты
4) проверка кода на соответствие стилю программирования checkstyle (http://checkstyle.sourceforge.net)
5) создание jar\war файла
6) создания meta-inf файла
7) создание javadoc
8) генерация классов для клиента к веб-сервису с помощью wsdl2java (из пакета apache cxf)
9) выполнение sql скриптов к СУБД
10) установка war файла на сервер приложений, например Tomcat
Можно ли заменить билдер в Eclipse и оставить только ant?
В Eclipse невозможно полностью отключить встроенный builder проекта, поэтому в данном случае исполнение задачи javac не будет иметь смысл.
Состав целей проекта:
default - цель по умолчанию
all - создание дистрибутива и тестирование
clean - удаление всех созданных файлов
dist - создание дистрибутива
docs - создание документации
test - запуск unit тестов
noop - вывод на экран названия проекта
diag - вывод параметров окружения ant.
Управление большими проектами:
С помощью задачи ant можно вызывать цели в других build файлах. Начиная с версии 1.7 появилась задача subant, которая может исполнять build файлы.
Подписаться на:
Сообщения (Atom)