<< Back to previous view

[OSUSER-7] LDAP credential provider - solution Created: 22/Dec/04  Updated: 22/Dec/04

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Task Priority: Major
Reporter: amichalec Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 7
Tags:
Participants: amichalec and osuser-issues

 Description   

Damn this issue tracker (or its config). I cannot neither add attachment nor
edit/comment... Let any admin cleans it up if necessary.

Here is a solution for https://osuser.dev.java.net/issues/show_bug.cgi?id=6 in a
form of listing.

andrew michalec.

=========================

/*

  • Copyright (c) 2002-2003 by OpenSymphony
  • All rights reserved.
    */
    package com.opensymphony.user.provider.ldap;

import com.opensymphony.user.Entity;
import com.opensymphony.user.UserManager;
import com.opensymphony.user.provider.CredentialsProvider;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.util.*;

import javax.naming.AuthenticationException;
import javax.naming.CommunicationException;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.*;

/**

  • Provider for checking credentials against a LDAP directory.
  • <p>
  • Tries to connect to an LDAP directory with the specified username/password.
    Succeeds or fails depending on whether the
  • LDAP authentication succeeds/fails.
  • <p>
  • The authentication algorithm is as follows:
  • <ul>
  • <li>Establish an anonymous or authenticated connection with LDAP
  • <li>Search within a subtree for a node representing the user, eg. search
    below 'ou=People,dc=example,dc=com' for (uid=fred) if the username is 'fred'.
  • <li>If a user node is found (eg. 'uid=fred,ou=People,dc=example,dc=com'),
    try to connect to LDAP again, using the
  • found node as the 'bind DN', and using the user's password.
  • <li>If this second connection succeeds, return true
  • </ul>
  • <p>A sample osuser.xml configuration:
  • <pre>
  • <provider class="com.opensymphony.user.provider.ldap.LDAPCredentialsProvider">
    <property
    name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</property>
    <property name="java.naming.provider.url">ldap://localhost:389</property>
    <property name="searchBase">ou=People,dc=example,dc=com</property>
    <property name="uidSearchName">uid</property>
    <property
    name="java.naming.security.principal">cn=admin,dc=example,dc=com</property>
    <property name="java.naming.security.credentials">secret</property>
    <property name="exclusive-access">true</property>
    </provider>
  • </pre>
  • The security principal and credentials lines are optional, depending on
    whether your initial connection need be authenticated or not.
  • <p>
  • Currently, there must be <strong>at least one other non-LDAP
    CredentialsProvider</strong> configured for this provider to work.
  • This is because there are user management features that
    LDAPCredentialsProvider does not provide on its own (create/delete user, change
    password).
  • When calls to these methods are made, LDAPCredentialsProvider delegates the
    call to the other CredentialsProvider implementation.
  • <p>
  • Notes:
  • <ul>
  • <li>Entering blank password will always fail, regardless of whether the
    underlying LDAP allows anonymous user connects.
  • <li>If the initial LDAP connection cannot be established, or there is an
    unexpected error, the authentication attempt
  • is passed on to other non-LDAP CredentialsProvider.
  • <li>If the user exists in LDAP but the password was incorrect, the module
    fails without consulting other CredentialsProviders.
  • <li>Turning logging up to DEBUG will reveal details on authentication attempts.
  • </ul>
    *
  • @author <a href="mailto:jeff@atlassian.com">Jeff Turner</a>
    */
    public class LDAPCredentialsProvider implements CredentialsProvider {
    //~ Static fields/initializers /////////////////////////////////////////////

private static final Log log = LogFactory.getLog(LDAPCredentialsProvider.class);
static private HashMap cache = new HashMap();

//~ Instance fields ////////////////////////////////////////////////////////

private Hashtable env;
private String searchBase;
private String uidSearchName;
private long timeout;

//~ Methods ////////////////////////////////////////////////////////////////

public boolean authenticate(String name, String password) {
// Do NOT allow null or empty passwords
// This is required as LDAP (by default) allows an empty password for an
existing user
// (if the password is not specified LDAP allows the user to connect,
and treats the user as
// an unauthenticated - anonymous user)
if ((password == null) || "".equals(password)) { return false; }

// check cache
TimeAndPassword tp = (TimeAndPassword) cache.get(name);

if ((tp != null) && tp.password.equals(password) && (tp.time >
System.currentTimeMillis())) {
if (log.isDebugEnabled()) { log.debug("Successful authentication for " + name + " from cached LDAP lookup"); }

return true;
}

DirContext ctx = null;

try { ctx = new InitialDirContext(env); } catch (NamingException e) { log.error("Could not connect to LDAP. Please check your " + "host ('" + env.get(Context.PROVIDER_URL) + "'), " + "bind DN ('" + env.get(Context.SECURITY_PRINCIPAL) + "') and bind password.", e); return tryOtherCredentialsProviders(name, password); }

StringBuffer filterBuffer = new
StringBuffer(uidSearchName).append("=").append(name);

String[] attrIDs = {uidSearchName};
SearchControls ctls = new SearchControls();
ctls.setReturningAttributes(attrIDs);
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);

if (log.isDebugEnabled()) { log.debug("Doing initial search: " + "username='" + env.get(Context.SECURITY_PRINCIPAL) + "', password='" + env.get(Context.SECURITY_CREDENTIALS) + "', base='" + searchBase + "', filter='" + filterBuffer + "'"); }

NamingEnumeration results = null;

try { results = ctx.search(searchBase, filterBuffer.toString(), ctls); } catch (NamingException e) { log.error("Connected to LDAP, but could not perform " + (env.containsKey(Context.SECURITY_PRINCIPAL) ? "authenticated" : "anonymous") + " search from base '" + searchBase + "'"); return tryOtherCredentialsProviders(name, password); }

StringBuffer dnBuffer = new StringBuffer();

try {
if (log.isDebugEnabled()) {
if ((results != null) && results.hasMore()) { log.debug("Found users"); } else { log.debug("No users found"); }
}

// Lotus Domino R5 LDAP server drops socket connection when
// switching credentials! First context (ctx) is used to iterate
// through results and only second context (ctx2) is used
// to authorize. Context ctx will survive whether ctx2 is dropped
// by Domino or not.
DirContext ctx2 = new InitialDirContext(ctx.getEnvironment());

while ((results != null) && results.hasMore()) {
SearchResult sr = (SearchResult) results.next();
dnBuffer = new StringBuffer();
dnBuffer.append(sr.getName());
dnBuffer.append(",");
dnBuffer.append(searchBase);

try { ctx2.removeFromEnvironment(Context.SECURITY_PRINCIPAL); ctx2.removeFromEnvironment(Context.SECURITY_CREDENTIALS); ctx2.addToEnvironment(Context.SECURITY_PRINCIPAL, dnBuffer.toString()); ctx2.addToEnvironment(Context.SECURITY_CREDENTIALS, password); } catch (NamingException e) { log.error("Connected and searched LDAP, but encountered unexpected error when switching authentication details.", e); continue; }

ctls = new SearchControls();
ctls.setReturningAttributes(new String[0]);
ctls.setSearchScope(SearchControls.OBJECT_SCOPE);

if (log.isDebugEnabled()) { log.debug("Searching below '" + dnBuffer + "' for '" + filterBuffer + "'"); }

try {
try { ctx2.search(dnBuffer.toString(), filterBuffer.toString(), ctls); } catch (CommunicationException ex) { log.info("Second phase connection failed. Trying to reconnect to bypass sort of Lotus Domino R5 problems."); // Second context (ctx2) lost; we recreate this context and try once more. ctx2 = new InitialDirContext(ctx2.getEnvironment()); ctx2.search(dnBuffer.toString(), filterBuffer.toString(), ctls); }
} catch (AuthenticationException ae) {
if (log.isDebugEnabled()) { log.debug("User with dn '" + dnBuffer + "' found, but authentication failed."); }

continue;
} catch (NamingException e) { log.error("Initial connect and search successful, but second phase connection to LDAP as '" + dnBuffer + "' failed.", e); continue; }

if (log.isDebugEnabled()) { log.debug("User '" + name + "' successfully authenticated; caching for " + timeout + " ms"); }

cache.put(name, new TimeAndPassword(System.currentTimeMillis() +
timeout, password));

return true;
}
} catch (NamingException e) { log.error("Connected but encountered error checking if LDAP had more results.", e); }

return tryOtherCredentialsProviders(name, password);
}

public boolean changePassword(String name, String password) {
// LDAP cannot change passwords, so look for the first
CredentialsProvider that can and wrap the call
Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) { return provider.changePassword(name, password); }
}
}

return false;
}

public boolean create(String name) { // LDAP doesn't support this feature, so instead call the first provider that does return false; }

public void flushCaches() { // flush the TimeAndPassword cache cache = new HashMap(); }

public boolean handles(String name) {
// check cache
TimeAndPassword tp = (TimeAndPassword) cache.get(name);

if ((tp != null) && (tp.time > System.currentTimeMillis())) {
if (log.isDebugEnabled()) { log.debug("Cached lookup: Credentials for '" + name + "' will be handled by LDAP provider"); }

return true;
}

// check other credentials providers, don't handle this name if at least
one other one doesn't
Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();
boolean handles = false;

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) {
if (log.isDebugEnabled()) { log.debug("'" + name + "' will be handled by LDAP"); }

handles = true;

break;
}
}
}

if (log.isDebugEnabled()) {
if (handles == false) { log.debug("Credentials for '" + name + "' NOT handled by LDAP, because '" + name + "' not handled by any other credentials provider. Check you have at least one other" + " credentials provider, and that they contain this user."); }
}

return handles;
}

public boolean init(Properties properties) {
if (log.isDebugEnabled()) { log.debug("LDAPCredentialsProvider $Revision: 1.3 $ initializing"); }

env = new Hashtable(properties);
env.put(javax.naming.Context.SECURITY_AUTHENTICATION, "simple");
searchBase = properties.getProperty("searchBase");
uidSearchName = properties.getProperty("uidSearchName");

try { timeout = Long.parseLong(properties.getProperty("cacheTimeout")); } catch (NumberFormatException e) { timeout = 1000 * 60 * 30; // 30 minutes default time }

return true;
}

public List list() { // LDAP cannot list users return Collections.EMPTY_LIST; }

public boolean load(String name, Entity.Accessor accessor) {
// LDAP doesn't support this feature, so instead call the first provider
that does
Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) { return provider.load(name, accessor); }
}
}

return true;
}

public boolean remove(String name) {
// LDAP cannot support removing users
Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) { return provider.remove(name); }
}
}

return false;
}

public boolean store(String name, Entity.Accessor accessor) {
// LDAP doesn't support this feature, so instead call the first provider
that does
Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) { return provider.store(name, accessor); }
}
}

return true;
}

/** Loop through non-LDAP credentials providers and tries to authenticate
against them. */
private boolean tryOtherCredentialsProviders(String name, String password) {
if (log.isDebugEnabled()) { log.debug("Couldn't authenticate against LDAP server, trying other CredentialsProviders"); }

Collection credentialsProviders =
UserManager.getInstance().getCredentialsProviders();

for (Iterator iterator = credentialsProviders.iterator();
iterator.hasNext() {
CredentialsProvider provider = (CredentialsProvider) iterator.next();
boolean isLDAP = provider instanceof LDAPCredentialsProvider;

if (!isLDAP) {
if (provider.handles(name)) {
if (log.isDebugEnabled()) { log.debug("Provider '" + provider.getClass().getName() + "' handles user; checking authentication..."); }

boolean result = provider.authenticate(name, password);

if (result) {
if (log.isDebugEnabled()) { log.debug("User authenticated by '" + provider.getClass().getName() + "'"); }

cache.put(name, new
TimeAndPassword(System.currentTimeMillis() + timeout, password));

return true;
} else {
if (log.isDebugEnabled()) { log.debug("Provider '" + provider.getClass().getName() + "' failed to authenticate user."); }

return false;
}
}
}
}

if (log.isDebugEnabled()) { log.debug("No non-LDAP authenticators could authenticate this user"); }

return false;
}

//~ Inner Classes //////////////////////////////////////////////////////////

private class TimeAndPassword {
public String password;
public long time;

public TimeAndPassword(long time, String password) { this.time = time; this.password = password; }
}
}






[OSUSER-6] LDAP credential provider Created: 22/Dec/04  Updated: 22/Dec/04

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: amichalec Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 6
Tags:
Participants: amichalec and osuser-issues

 Description   

LDAPCredentialsProvider class has two logical flaws:
1. Walking through matching results (and switching credentials) can cause an
exception that skip that loop (and any left potentially correct entries) trying
at once other credentials providers.
2. dnBuffer is not cleaned in loop causing incorrect DN construction.

Also for Lotus Domino R5 it causes problems (Domino LDAP server drops connection
when attempt to switch credentials for bound context).

I have changed all these problems and tested with Lotus Domino R5 LDAP server.
Check this code with other LDAP servers and include into OSUser latest release,
please.






[OSUSER-5] the seesionFactory is null in propertySet module when using OSUser Created: 11/Nov/03  Updated: 11/Nov/03

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Bug Priority: Blocker
Reporter: simonxikun Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows 2000
Platform: PC


Issuezilla Id: 5
Tags:
Participants: osuser-issues and simonxikun

 Description   

when using OSUser with hibernate provider, I set email by user.setEmail(), but I
get the NullPointException. After tracking some code, I find that in PropertySet
module, it could build the SessionFactory of hibernate.

16:24:12,647 DEBUG HibernatePropertySet:120 - Setting up property set with
hibernate provider passed in args.
16:24:12,657 INFO DefaultHibernateConfigurationProvider:49 - ***shit session
factory is null**added by simon xikun*
16:24:12,677 INFO HibernatePropertySetDAOImpl:40 - in the
HibernatePropertySetDAOImpl's constructor method, the sssionFactory is null
added by simonxikun
16:24:12,687 INFO HibernatePropertySetDAOImpl:98 - session factory is null ----
added by simon xikun

I added some log code in the source code and get the info above.






[OSUSER-4] RuntimeException swallowed in UserManager.getInstance Created: 28/Oct/03  Updated: 28/Oct/03

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Bug Priority: Major
Reporter: jdane Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 4
Tags:
Participants: jdane and osuser-issues

 Description   

UserManager.getInstance() has somethng lile

try { get the instance }
catch (RuntimeException e) { return null; }

this can make debugging difficult. there is a logger available in the class. why not use it?






[OSUSER-3] No docs in www Created: 15/Oct/03  Updated: 15/Oct/03

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Task Priority: Major
Reporter: diongillard Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


File Attachments: Text File index.html.patch    
Issuezilla Id: 3
Tags:
Participants: diongillard and osuser-issues

 Description   

the www/ directory has a skeleton html file. It should point back to
opensymphony.com



 Comments   
Comment by diongillard [ 15/Oct/03 08:23 PM ]

Created an attachment (id=1)
Add link to os home page





[OSUSER-2] User's properties not deleted when user is removed Created: 09/Oct/03  Updated: 09/Oct/03

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Task Priority: Major
Reporter: genegc Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 2
Tags:
Participants: genegc and osuser-issues

 Description   

When a user is deleted, the properties associated with that user in the
OS_PROPERTYENTRY should be deleted as well.






[OSUSER-1] build.xml not working Created: 21/Aug/03  Updated: 21/Aug/03

Status: Open
Project: osuser
Component/s: www
Affects Version/s: current
Fix Version/s: milestone 1

Type: Task Priority: Major
Reporter: cwidhelm Assignee: osuser-issues
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 1
Tags:
Participants: cwidhelm and osuser-issues

 Description   

The build.xml was not working correctly. I have modified a couple of things.

Added a ${tmp} property for temp location that is created during the example
target execution.

Originally the example target was trying to copy files from lib/lib, which
doesn't exist, these have been changed to lib/core to support the current
directory strucutre.

I would attach it but instead I will paste it.

>>---------------------------------------------------------------------<<
<?xml version="1.0"?>

<!-- OSUser build file - http://www.opensymphony.com/osuser -->

<project name="osuser" default="jar" basedir=".">
<property file="build.properties"/>
<path id="cp">
<fileset dir="lib">
<include name="*/.jar"/>
</fileset>
</path>

<path id="jalopy.classpath">
<fileset dir="lib/build/jalopy">
<include name="*.jar"/>
</fileset>
</path>

<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
<classpath refid="jalopy.classpath"/>
</taskdef>

<!-- Setup details -->
<target name="init">
<tstamp/>
<property name="tmp" value="tmp"/>

<property name="lib" value="lib"/>
<property name="lib.core" value="${lib}/core"/>
<property name="lib.build" value="${lib}/build"/>
<property name="lib.optional" value="${lib}/optional"/>

<property name="src" value="src"/>
<property name="src.java" value="${src}/java"/>
<property name="src.test" value="${src}/test"/>
<property name="src.etc" value="${src}/etc"/>

<property name="propertyset.jar" value="propertyset-1.3-dev.jar"/>
<property name="oscore.jar" value="oscore-2.2.1.jar"/>
<property name="build" value="build"/>
<property name="build.test" value="${build}/test"/>
<property name="build.java" value="${build}/java"/>

<property name="dist" value="dist"/>
<property name="deployment" value="src/etc"/>
<property name="docs" value="docs"/>

<property name="clover.initstring" location="testcoverage.db"/>

<property name="packages" value="com.opensymphony..user.*"/>

<available property="junit.available" classname="junit.framework.TestCase"/>
<available property="clover.available"
classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter"/>
</target>

<target name="junit-check" depends="init" unless="junit.available">
<fail message="Cannot run test cases. Please copy lib/build/junit-3.8.1.jar
to ${ant.home}/lib"/>
</target>

<target name="clover-check" depends="init" unless="clover.available">
<fail message="Cannot run coverage tests. Please copy
lib/build/clover-1.2.jar to ${ant.home}/lib"/>
</target>

<!-- Remove all built files -->
<target name="clean" depends="init">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete>
<fileset dir="." includes="testcoverage.db*"/>
</delete>
</target>

<!-- Compile Java -->
<target name="java" depends="init">
<mkdir dir="${build.java}/META-INF"/>
<javac destdir="${build.java}" classpathref="cp" debug="on">
<src path="${src.java}"/>
</javac>
<copy todir="${build.java}">
<fileset dir="${src.java}">
<exclude name="*/.java"/>
<exclude name="**/package.html"/>
</fileset>
</copy>
<copy file="${src.etc}/ejb/ejb-jar.xml" todir="${build.java}/META-INF"/>
<copy file="${src.etc}/orion/orion-ejb-jar.xml" todir="${build.java}/META-INF"/>
<copy file="${src.etc}/jrun/jrun-ejb-jar.xml" todir="${build.java}/META-INF"/>
<copy todir="${build.java}">
<fileset dir="${src.etc}/pramati" />
</copy>
<copy todir="${build.java}/META-INF">
<fileset dir="${src.etc}/castor" />
</copy>
<copy todir="${build.java}/META-INF">
<fileset dir="${src.etc}/jboss" />
</copy>
<copy todir="${build.java}/META-INF">
<fileset dir="${src.etc}/weblogic" />
</copy>
</target>

<target name="test" depends="clover-check,junit-check">
<taskdef name="junit"
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

<mkdir dir="${build.test}/META-INF"/>
<javac srcdir="${src.java}" destdir="${build.test}" debug="on"
classpathref="cp" compiler="org.apache.tools.ant.taskdefs.CloverCompilerAdapter" />
<javac srcdir="${src.test}" destdir="${build.test}" classpathref="cp"
debug="on"/>
<copy todir="${build.test}">
<fileset dir="${src.test}">
<include name="*/.xml" />
</fileset>
</copy>
<mkdir dir="${dist}/docs/junit"/>
<junit printsummary="withOutAndErr" haltonfailure="no" haltonerror="yes"
showoutput="yes">
<classpath>
<pathelement location="${build.test}"/>
<path refid="cp"/>
</classpath>

<formatter type="xml"/>

<batchtest todir="${dist}/docs/junit">
<fileset dir="${src.test}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>

<target name="format" depends="java">
<jalopy fileformat="unix" convention="${src.etc}/jalopy.xml" history="file"
historymethod="adler32" loglevel="error" threads="2" classpathref="cp">
<fileset dir="${src.java}">
<include name="*/.java"/>
</fileset>
<!-- <fileset dir="${src.test}">
<include name="*/.java" />

</fileset>
-->
</jalopy>
</target>

<!-- Build jar archive -->
<target name="jar" depends="format">
<mkdir dir="${dist}"/>
<jar basedir="${build.java}" jarfile="${dist}/${name}-${version}.jar"/>
</target>

<target name="example" depends="jar">
<mkdir dir="${tmp}"/>
<!-- copies the osuser jar without the version info attached to the jar
file name, as that is how its referenced in the
example/META-INF/application.xml file -->
<copy tofile="${tmp}/example/${name}.jar">
<fileset dir="${dist}">
<include name="${name}*.jar"/>
</fileset>
</copy>
<copy todir="${tmp}/example">
<fileset dir="${lib}/build/">
<include name="castor-0.9.3.9.jar"/>
</fileset>
<fileset dir="${lib}/core">
<include name="oscore**"/>
<include name="prop**"/>
</fileset>
</copy>
<copy todir="${tmp}/example">
<fileset dir="example">
<include name="META-INF/**"/>
<include name="manager/**"/>
</fileset>
</copy>
<mkdir dir="${tmp}/example/lib"/>
<copy todir="${tmp}/example/lib">
<fileset dir="${lib}/build/">
<include name="log4j.jar"/>
</fileset>
<fileset dir="${lib}/optional/">
<include name="*.jar"/>
</fileset>
<fileset dir="${lib}/core">
<include name="common**"/>
</fileset>
</copy>
<jar basedir="example/testclient" jarfile="${tmp}/example/testclient.jar"
manifest="example/testclient/META-INF/MANIFEST.MF"/>
<jar basedir="${tmp}/example/manager" jarfile="${tmp}/example/manager.war"/>
<copy file="${deployment}/pramati/pramati-j2ee-server.xml"
todir="${tmp}/example/"/>
<copy file="${deployment}/pramati/pramati-or-map.xml" todir="${tmp}/example/"/>
<copy file="${deployment}/pramati/queries.props" todir="${tmp}/example/"/>
<jar basedir="${tmp}/example" jarfile="${dist}/osuser_example.ear"/>

</target>

<target name="javadocs" depends="init">
<mkdir dir="${dist}/docs/api"/>
<javadoc sourcepath="${src.java}" destdir="${dist}/docs/api"
packagenames="${packages}" classpathref="cp" author="true" version="true"
windowTitle="${name} ${version} API" doctitle="${name}" footer="See <a
href="http://www.opensymphony.com&quot;&gt;www.opensymphony.com&lt;/a&gt;
for more information." use="true" verbose="false"/>
</target>

<target name="clover.report" depends="test">
<java classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter"
fork="true">
<arg line="--outputdir ${dist}/docs/clover --showSrc --initstring
${clover.initstring} --title '${name}'"/>
<classpath refid="cp"/>
</java>
</target>

<target name="junit.report" depends="test">
<junitreport todir="${dist}/docs/junit">
<fileset dir="${dist}/docs/junit">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dist}/docs/junit"/>
</junitreport>
</target>

<target name="docs" depends="javadocs, clover.report, junit.report">
<copy todir="${dist}/docs">
<fileset dir="${docs}"/>
</copy>
</target>

</project>
>>---------------------------------------------------------------------<<






Generated at Sun Apr 20 17:15:33 UTC 2014 using JIRA 4.0.2#472.