Skip to content

[with maven plugin] create reporter from remote database

License

Notifications You must be signed in to change notification settings

tinywind/SCHEME-REPORTER

Repository files navigation

SCHEME-REPORTER

SCHEME-REPORTER is a tool designed to generate reports from remote databases in various formats such as HTML, PDF, Excel, and DOCX. It supports a flexible configuration and can be easily integrated into Maven or Gradle build systems.

Features

  • Supports multiple report formats: HTML, PDF, Excel, and DOCX
  • Custom reporter class support
  • Uses Thymeleaf as the HTML template engine
  • Updated to support JDK 17
  • Easily integrated with Maven and Gradle

Configure Maven

To use SCHEME-REPORTER with Maven, add the following configuration to your pom.xml file:

<build>
    <plugins>
        <plugin>
            <groupId>org.tinywind</groupId>
            <artifactId>scheme-reporter-maven</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <phase>none</phase>
                </execution>
            </executions>
            <configuration>
                <jdbc>
                    <driverClass>org.h2.Driver</driverClass>
                </jdbc>
                <database>
                    <url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</url>
                    <user>sa</user>
                    <password></password>
                    <includes>.*</includes>
                    <excludes>schema_version|jettysessions|jettysessionids</excludes>
                    <inputSchema>PUBLIC</inputSchema>
                </database>
                <generator>
                    <!-- Available formats: html, pdf, excel, docx -->
                    <!-- Or use a custom reporter class implementing the Reportable interface -->
                    <reporterClass>pdf</reporterClass>
                    <!-- Thymeleaf template file for HTML reporter class. If not set, the default template will be used. -->
                    <!-- Refer to: https://raw.githubusercontent.com/tinywind/SCHEME-REPORTER/master/scheme-reporter/src/main/resources/asset/default.html -->
                    <template>./asset/template.html</template>
                    <outputDirectory>doc</outputDirectory>
                </generator>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>com.h2database</groupId>
                    <artifactId>h2</artifactId>
                    <version>2.2.224</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

Running the Maven Plugin

To generate a report using Maven, run the following command:

mvn scheme-reporter-maven:generate

Configure Gradle

To use SCHEME-REPORTER with Gradle, add the following configuration to your build.gradle.kts file:

plugins {
    id("org.tinywind.scheme-reporter") version "1.0.0"
}

dependencies {
    schemaReporter("com.mysql:mysql-connector-j:8.4.0")
}

schemaReporter {
    jdbc {
        driverClass = "com.mysql.cj.jdbc.Driver"
    }
    database {
        url = "jdbc:mysql://127.0.0.1:3306/database"
        user = "user"
        password = "password"
        inputSchema = "database"
    }
    generator {
        // Available formats: pdf, docx, excel, html
        // Or use a custom reporter class implementing the Reportable interface
        reporterClass = "pdf"
        // Thymeleaf template file for HTML reporter class. If not set, the default template will be used.
        // Refer to: https://raw.githubusercontent.com/tinywind/SCHEME-REPORTER/master/scheme-reporter/src/main/resources/asset/default.html
        template = "./asset/template.html"
        outputDirectory = "/doc"
    }
}

Running the Gradle Task

To generate a report using Gradle, run the following command:

./gradlew generateSchemeReport

For more details on using the Scheme Reporter Gradle Plugin, refer to the Scheme Reporter Gradle Plugin README.

Additional Configuration in Gradle

If the plugin does not process correctly, you may need to add mavenCentral() to the pluginManagement section of the repositories in your Gradle settings.

pluginManagement {
    repositories {
        mavenCentral() // note: add this repository
        gradlePluginPortal()
        maven { url = uri("https://jitpack.io") }
    }
}

Output Samples

Here are some sample outputs generated by SCHEME-REPORTER:

License

Licensed under the Apache License, Version 2.0. If you are using this tool with commercial databases, please refer to the jOOQ licensing page for more information.

Contribution

Contributions are welcome! If you find any issues or have suggestions, please open an issue or submit a pull request on GitHub.


About

[with maven plugin] create reporter from remote database

Resources

License

Stars

Watchers

Forks

Packages

No packages published