Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tscfg-maven-plugin #28

Closed
wants to merge 9 commits into from
Closed

Conversation

timvlaer
Copy link

This PR contains a maven plugin that generates Typesafe Config using the tscfg tool.

See README for usage details. Example:

            <plugin>
                <groupId>com.github.carueda</groupId>
                <artifactId>tscfg-maven-plugin</artifactId>
                <version>0.2.0</version>
                <configuration>
                    <templateFile>config-spec/app.spec.conf</templateFile>
                    <packageName>be.timvanlaer.service.config</packageName>
                    <className>ApplicationConfig</className>
                </configuration>
                <executions>
                    <execution>
                        <id>tscfg-sources</id>
                        <goals>
                            <goal>generate-config-class</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When you run mvn generate-sources, the plugin will read app.spec.conf in the /config-spec directory at the root of your Maven project. It will generate a Java 8 class be.timvanlaer.service.config.ApplicationConfig.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.727% when pulling b53a55f on timvlaer:feature/maven-plugin into b0182c3 on carueda:master.

@carueda
Copy link
Owner

carueda commented Nov 1, 2017

Hey @timvlaer thanks much for your interest and willingness to contribute!

Sorry, I still have to look at this carefully but at first glance I'm wondering whether what's already published can provide the intended core functionality here; I'm referring to #24, in particular this #24 (comment) ?

@timvlaer
Copy link
Author

timvlaer commented Nov 1, 2017

Hi @carueda,
This plugin is intended for projects that want to generate a Typesafe Config class without executing the tscfg manually on the command line. The plugin executes the generate command.
I might be wrong, but I don't get the relationship with #24.
Regards,
Tim

@timvlaer
Copy link
Author

timvlaer commented Nov 1, 2017

I think this is what intended in #21 (also in FAQ) but for Maven projects instead of SBT.

@carueda
Copy link
Owner

carueda commented Nov 1, 2017

Can you please indicate how to publish the plugin? This is not clear to me by looking at your pom or readme. Thx.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.727% when pulling ce6a42e on timvlaer:feature/maven-plugin into b0182c3 on carueda:master.

@timvlaer
Copy link
Author

timvlaer commented Nov 2, 2017

I added the Sonatype oss repository in distributionManagement, so you should be able to deploy this plugin using the mvn deploy command. You probably already added your sonatype jira-id to your settings.xml.

In the meantime I was also looking to extend the Travis CI build to include this project. However, this seems not straight-forward, since it's a completely separated project.

So that started me thinking that we might create a new top-level github repo/project for this plugin. What do you think?

Arguments for creating a new project:

  • the maven plugin is a completely separate artefact, which can evolve at a different pace
  • the CI will be different and not necessary have the same requirements

Arguments for adding the plugin to this project:

  • maven dependency on tscfg can be kept in sync during further development
  • if needed, new features can be added simultaneously in the core and plugin
  • the maven plugin has no raison d'être without the core tscfg project

@carueda
Copy link
Owner

carueda commented Nov 2, 2017

Yes, the "separated project" quick reaction came to mind when I first looked at this PR.

You are making good points. In general I'm happy to incorporate your plugin here as long as its testing, CI, and publishing are streamlined, ideally as part of the existing build.sbt (not to mention that you or other potential collaborators will be in charge or maintaining it ;)). But it seems not as straightforward per your comments. Do you have a preference? I really appreciate your time on this!

@timvlaer
Copy link
Author

timvlaer commented Nov 6, 2017

Ok, let's start with a separated project then and see how things evolve over time. I'll try to create the project in the coming days and let you know where to find it. It might be interesting to refer it in the readme of tscfg project, If you don't mind.

@timvlaer timvlaer closed this Nov 6, 2017
@carueda
Copy link
Owner

carueda commented Nov 6, 2017

No, I won't mind at all! and yes, do let me know when you have news about the new project. Thanks again!

@timvlaer
Copy link
Author

To keep you posted, I created a new project with everything in place.
https://github.com/timvlaer/tscfg-maven-plugin

I still need to add the artefact to the Maven Central Repo. That will probably be something for next week.

@timvlaer
Copy link
Author

Added to the central repo: https://oss.sonatype.org/#nexus-search;quick~tscfg-maven-plugin

@carueda
Copy link
Owner

carueda commented Nov 15, 2017

Great, thanks much again for this.

I just updated the readme to link to your plugin (under the running section). Please take a look and let me know if you would like any changes to the way I'm referencing your plugin.

@timvlaer
Copy link
Author

This looks good to me, thanks for adding it to the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants