#!/bin/bash
#
# Copyright (c) 2024, 2025 Contributors to the Eclipse Foundation
# Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0, which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception, which is available at
# https://www.gnu.org/software/classpath/license.html.
#
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#

AS_CONFIG="$(dirname "$(realpath "$0")")/../config"
AS_CONFIG_SH="${AS_CONFIG}/config.sh"
source "${AS_CONFIG_SH}" "$AS_CONFIG" || { echo "${AS_CONFIG_SH} not found" >&2; exit 1; }
AS_MODULES="$AS_INSTALL/modules"
WS_CLASSPATH="$AS_MODULES/webservices-api-osgi.jar:$AS_MODULES/webservices-osgi.jar:$AS_MODULES/jakarta.xml.bind-api.jar:$AS_MODULES/jaxb-osgi.jar:$AS_MODULES/jakarta.activation-api.jar:$AS_MODULES/angus-activation.jar"
exec "$JAVA" $WSGEN_OPTS --module-path "$ASADMIN_MODULEPATH" --add-modules ALL-MODULE-PATH -cp "$WS_CLASSPATH" com.sun.tools.ws.WsGen "$@"
