schemacrawler / SchemaCrawler-Report-Maven-Plugin

Generate SchemaCrawler reports for Maven generated project websites
Eclipse Public License 2.0
8 stars 6 forks source link

Custom config.properties Overwritten #7

Closed allan-shoup closed 4 years ago

allan-shoup commented 4 years ago

I have this in <pluginManagement>

                <plugin>
                    <groupId>us.fatehi</groupId>
                    <artifactId>schemacrawler-maven-plugin</artifactId>
                    <version>16.9.3-2</version>
                    <configuration>
                        <url>${db.jdbc.url}</url>
                        <user>${db.schema.username}</user>
                        <password>${db.schema.password}</password>
                        <command>schema</command>
                        <outputfile>database-schema.pdf</outputfile>
                        <outputformat>pdf</outputformat>
                        <title>${db.schema.name} Schema</title>
                        <schemas>${db.schema.name}</schemas>
                        <infolevel>maximum</infolevel>
                        <config>custom.config.properties</config>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>mysql</groupId>
                            <artifactId>mysql-connector-java</artifactId>
                            <version>${mysql.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

Here is what is in the custom.config.properties:

schemacrawler.format.hide_foreignkey_names=true

When I run mvn schemacrawler:schemacrawler -X I see these messages:

Aug 13, 2020 7:53:45 PM schemacrawler.utility.PropertiesUtility loadProperties
INFO: Loading properties from </mnt/c/workspace/example/custom.config.properties>
Aug 13, 2020 7:53:45 PM schemacrawler.tools.iosource.FileInputResource openNewInputReader
INFO: Opened input reader to file </mnt/c/workspace/example/custom.config.properties>
Aug 13, 2020 7:53:45 PM schemacrawler.tools.iosource.InputReader close
INFO: Closing input reader
[DEBUG] schemacrawler.tools.executable.SchemaCrawlerExecutable@174e1b69[
  additionalConfiguration: 
schemacrawler.format.append_output: false
schemacrawler.format.hide_constraint_names: false
schemacrawler.format.hide_foreignkey_names: false
...
allan-shoup commented 4 years ago

I think the problem might be caused in SchemaCrawlerMojo when the properties loaded from the custom config file: additionalConfiguration = PropertiesUtility.loadConfig(new FileInputResource(configPath)); are overwritten by default properties: additionalConfiguration.putAll(textOptionsConfig);

sualeh commented 4 years ago

Thanks, @allan-shoup - I will take a look.

sualeh commented 4 years ago

@allan-shoup - please use SchemaCrawler 16.9.4.

allan-shoup commented 4 years ago

Works now. Thanks for the quick turnaround!