> On Nov 10, 2023, at 10:31 AM, Veniamin Gvozdikov 
> <[email protected]> wrote:
> 
> Hello.
> 
> Currently I use maven command to deploy schema (from docs on github):
> 
> mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml
> 
> Is it possible to use it with java -jar file.jar or another approach
> without using maven?
> 

Yes, done by calling ant directly.  You’ll need to explicitly map all of the 
jars to the classpath in the script. Here is a sample where I used jars staged 
in tomcat/webapps fortress rest deployment.

You could probably export the classpath as an environment variable before 
calling the ant script. It’s been awhile since I’ve tried this.
  
## Invoke ant to run script:

```bash
$ANT_HOME/bin/ant -buildfile ldap/setup/LoadGroupSetupAnt.xml
```

## sample load script setting classpath as properties:
```
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="Fortress LDAP Group Test 002 Data">
<property name="home.dir" value = "../../" />
<property name="dist.dir" value = 
"/home/smckinn/Tools/apache-tomcat-10.1.8/webapps/fortress-rest-3.0.1-SNAPSHOT/WEB-INF/lib"
 />
<property name="target.dir" value = "${home.dir}/target" />
<property name="config" value="${home.dir}/config"/>
<property name="fortress" 
value="${target.dir}/fortress-core-3.0.1-SNAPSHOT.jar"/>
<property name="log4j-api" value="${dist.dir}/log4j-api-2.20.0.jar"/>
<property name="log4j-core" value="${dist.dir}/log4j-core-2.20.0.jar"/>
<property name="log4j-slf4j2-impl" 
value="${dist.dir}/log4j-slf4j2-impl-2.20.0.jar"/>
<property name="slf4j-api" value="${dist.dir}/slf4j-api-2.0.6.jar"/>
<property name="api-all" value="${dist.dir}/api-all-2.1.4.jar"/>
<property name="jgrapht" value="${dist.dir}/jgrapht-core-1.5.2.jar"/>
<property name="commons-configuration" 
value="${dist.dir}/commons-configuration-1.10.jar"/>
<property name="commons-lang" value="${dist.dir}/commons-lang-2.6.jar"/>
<property name="commons-logging" value="${dist.dir}/commons-logging-1.0.4.jar"/>
<property name="commons-pool" value="${dist.dir}/commons-pool2-2.11.1.jar"/>
<property name="accelerator-api" 
value="${dist.dir}/accelerator-api-1.0-RC41.jar"/>
<property name="accelerator-impl" 
value="${dist.dir}/accelerator-impl-1.0-RC41.jar"/>
<property name="api-ldap-codec-core" 
value="${dist.dir}/api-ldap-codec-core-2.1.4.jar"/>
<property name="api-ldap-extras-codec" 
value="${dist.dir}/api-ldap-extras-codec-2.1.4.jar"/>
<property name="api-ldap-extras-codec-api" 
value="${dist.dir}/api-ldap-extras-codec-api-2.1.4.jar"/>
<property name="mina-core" value="${dist.dir}/mina-core-2.2.2.jar"/>
<property name="caffeine" value="${dist.dir}/caffeine-2.9.3.jar"/>
<property name="ehcache" value="${dist.dir}/ehcache-2.10.9.2.jar"/>
<property name="commons-collections" 
value="${dist.dir}/commons-collections4-4.4.jar"/>
<taskdef classname="org.apache.directory.fortress.core.ant.FortressAntTask" 
name="FortressAdmin”>

<classpath 
path="${config}:${fortress}:${slf4j-api}:${log4j-api}:${log4j-core}:${jgrapht}:${api-all}:${commons-configuration}:${commons-lang}:${commons-logging}:${commons-pool}:${log4j-slf4j2-impl}:${accelerator-api}:${accelerator-impl}:${api-ldap-codec-core}:${api-ldap-extras-codec}:${api-ldap-extras-codec-api}:${mina-core}:${caffeine}:${ehcache}:${commons-collections}"/>
</taskdef>

<target name="all">
  <FortressAdmin>
…
   </FortressAdmin>
</target>
</project>
```


> -- 
> Regards,
> Veniamin


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to