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

Maven plugin #1

Open
zambrovski opened this issue Aug 29, 2022 · 8 comments
Open

Maven plugin #1

zambrovski opened this issue Aug 29, 2022 · 8 comments

Comments

@zambrovski
Copy link
Collaborator

Hi folks,

I love the idea of a language for modelling context maps and would like to integrate it in my CI/CD. For this purpose, I would like to create an integration with Apache Maven and generate diagrams during build to be included into documentation.

Do you think it is reasonable? I could provide a PR with a Maven Mojo covering the same scope as the CLI... Probably, it is a good idea to separate it into an independent repository..

What is your opinion on that?

Cheers,

Simon

@stefan-ka
Copy link
Member

Hi @zambrovski

Sure, I also have thought about that...

Currently I just do it by including the CLI as dependency...

    <dependencies>
        <dependency>
            <groupId>org.contextmapper</groupId>
            <artifactId>context-mapper-cli</artifactId>
            <version>${contextmapper.version}</version>
        </dependency>
    </dependencies>

...and then use the exec-maven-plugin to generate my stuff. Here an example for the PlantUML generator:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>generate-pumls</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>org.contextmapper.cli.ContextMapperCLI</mainClass>
                            <arguments>
                                <argument>generate</argument>
                                <argument>-i</argument>
                                <argument>sample-architecture/src/main/cml/sample-domain.cml</argument>
                                <argument>-g</argument>
                                <argument>plantuml</argument>
                                <argument>-o</argument>
                                <argument>sample-architecture/target/diagrams</argument>
                            </arguments>
                            <cleanupDaemonThreads>false</cleanupDaemonThreads>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

You could basically do the same to generate the Context Map. The generator parameter (-g) just had to be replaced with context-map, as documented here: https://github.com/ContextMapper/context-mapper-cli

But I totally agree that it could be done nicer with a Maven plugin. If you would want to do that, I would like to have it in a separate repository, yes. I could create one, just let me know when you are ready with your PR ;)

Best regards,
Stefan

@zambrovski
Copy link
Collaborator Author

Great.. Will do soon...

@zambrovski
Copy link
Collaborator Author

Hi,

I created a repository with implementation here:

https://github.com/holixon/context-mapper-maven-plugin

I could transfer it into your org, if you like it.

Cheers,

Simon

@zambrovski
Copy link
Collaborator Author

By the way - currently it is only the basic integration. Let us start with that and extend it further afterwards... I envision not to specify single model files, but specify file sets for generation...

@stefan-ka
Copy link
Member

Sure @zambrovski. You can initiate the transfer! Thank you very much for your work.

@zambrovski
Copy link
Collaborator Author

I initialized the transfer to you (@stefan-ka). Please accept it and then transfer it to the organization (it only works like this, since I'm not a member of ContextMapper)...

In the same time - I would join with pleasure.

I believe we could do some more interesting stuff together.
Are you following the jmolecules project? I think those two projects should have more in common...

@stefan-ka
Copy link
Member

stefan-ka commented Sep 2, 2022 via email

@stefan-ka
Copy link
Member

Open TODOs here:

  • Improve documentation (README, etc.)
  • Setup CI/CD
  • Setup publication to Maven Central
  • TBD: new/missing features in plugin?

@stefan-ka stefan-ka transferred this issue from ContextMapper/context-mapper-dsl Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants