#!/bin/bash

# 设置 JAVA_HOME（如果需要）
# export JAVA_HOME=/path/to/java

# 构建类路径
CLASSPATH="target/test-classes:target/classes"

# 添加 Maven 依赖
MAVEN_REPO="$HOME/.m2/repository"

# 添加必要的依赖 JAR 文件
CLASSPATH="$CLASSPATH:$MAVEN_REPO/com/baomidou/mybatis-plus-generator/3.5.3/mybatis-plus-generator-3.5.3.jar"
CLASSPATH="$CLASSPATH:$MAVEN_REPO/com/baomidou/mybatis-plus-core/3.4.3.3/mybatis-plus-core-3.4.3.3.jar"
CLASSPATH="$CLASSPATH:$MAVEN_REPO/com/baomidou/mybatis-plus-annotation/3.4.3.3/mybatis-plus-annotation-3.4.3.3.jar"
CLASSPATH="$CLASSPATH:$MAVEN_REPO/com/ibeetl/beetl/3.15.10.RELEASE/beetl-3.15.10.RELEASE.jar"
CLASSPATH="$CLASSPATH:$MAVEN_REPO/mysql/mysql-connector-java/8.0.29/mysql-connector-java-8.0.29.jar"
CLASSPATH="$CLASSPATH:$MAVEN_REPO/org/mybatis/mybatis/3.5.7/mybatis-3.5.7.jar"

echo "运行 ShopGenerator..."
echo "类路径: $CLASSPATH"

# 运行生成器
java -cp "$CLASSPATH" com.gxwebsoft.generator.ShopGenerator

echo "生成器运行完成！"
