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

[docs] Would it be possible to provide some more extensive documentation with examples and best practices? #138

Open
lfvjimisola opened this issue Dec 27, 2022 · 8 comments

Comments

@lfvjimisola
Copy link

lfvjimisola commented Dec 27, 2022

Short summary:

UPDATE: This comment #21 (comment) helped me a lot to understand composite, tiles etc.

I've spent a good couple of hours trying to see how we can use Maven Tiles with our setup. It is still not clear to me.
The lingo is somewhat new with things such as reactor build, multi-module build, composite poms, inherit config etc.

Don't think we have a difficult use-case but I'm feeling like and I'm doing something wrong. And it is not obvious for me how it should be structured from reading the documentation.

I know that an issue is not an ideal place to have a disussion, would you consider activating GitHub Discussions for this project, so that we can help each other out there?

I've checked: #21 #52 #69

Long(er) summary:

I would be really useful if the tiles mentioned under Composing Build functionality
are available as examples. An example project that covers most cases.

The project README mentions "Richard and Mark will be putting together a short book with tutorials for a better approach to building using Maven, but this is the short explanation" - is available somewhere?

From the README it's unclear to me what the difference is of:

  1. including a tile under plugin configuration in pom.xml or
  2. including within in tile.xml

Things that I'm currently find challenging and where I think documentation would be useful:

  • properties: Shall they always be in tile.xml? Is there a difference if we place them in pom.xml or tile.xml?
  • I currently have some properties that are placed in a tile.xml and they are available in another tile (that has this tile a dependency)
  • Spring Boot sets version using , how do we do that in the right way? We currently have two different tiles that needs to use the same Spring Boot versions setting.
  • How do I set maven plugin versions it the correct way? E.g. Maven Plugin versions are typically set expclitity (see below). E.g. setting versions for maven-compiler-plugin/maven-surefire-plugin/etc can be done e.g. in a java-tile w/o using pluginManagement, but I'm not sure where to do it for maven-clean-plugin, maven-install-plugin etc. Those are not links to Java but rather just Maven. Is a composite for maven (with pluginManagement) the solution and if so, is that composite also a tile, do I use regular or include it as tile dependency? (I haven't been able to get it to work yet)
<pluginManagement>
    <!-- 
        lock down plugins versions to avoid using Maven defaults, in alpabetic order
        for latest versions see: https://maven.apache.org/plugins/index.html
    -->
    <plugins>
        <!-- standard Apache Maven plugins -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>3.2.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
                <source>17</source>
                <target>17</target>
                <release>17</release>
                <encoding>UTF-8</encoding>
                <showWarnings>true</showWarnings>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>3.1.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.3.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>3.4.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.3.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.12.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M7</version>
        </plugin>
        <plugin>
            <groupId>org.sonarsource.scanner.maven</groupId>
            <artifactId>sonar-maven-plugin</artifactId>
            <version>3.9.1.2184</version>
        </plugin>
    </plugins>
</pluginManagement>

I'll try to explain our use-case:

We currently use standard Maven inheritance and it's troublesome to say the least....

We have 3 different POMs that are used for releasing artifacts: standard library, spring boot library and spring boot application.

We would like to use tiles to handle:

  • common things such as javadoc, testing, compile etc.
  • spring boot library dependencies: used by both SB library and application
  • spring boot plugin: used only by SB application
  • for various dependencies such as camel, openapi/springdoc etc: i.e. if a project uses OpenAPI it should just be able to refer to the openapi tile for dependencies and plugin configuration
@lfvjimisola
Copy link
Author

lfvjimisola commented Dec 29, 2022

@lfvjimisola lfvjimisola changed the title [docs] Would it be possible to provide some more examples? [docs] Would it be possible to provide some more extensive documentation with examples and best practices? Dec 29, 2022
@lfvjimisola
Copy link
Author

And my PoC of Maven Tiles for our use-cases and the review of two other developers our team has just decided that we won't use Maven Tiles as of now. We are afraid that we end up with other stuff that won't work for us (such as integration with VS Code).

It would be really good if the Maven Tiles README was updated with known limitations/workarounds such as:

@lfvjimisola
Copy link
Author

FYI. Bug eclipse-m2e/m2e-core#118 has now been fixed.

@lfvjimisola
Copy link
Author

@talios Is this project still alive? We picked up this trail now that the bug in eclipse-m2e has been fixed but are struggling a bit due to lack of documentation. Is there a forum/chat for asking questions?

@talios
Copy link
Member

talios commented Oct 10, 2023

@lfvjimisola it is still alive - documentation still remains something I really work on. Forum/chat - as for a chat - there was the old Gitter we had, which I see has moved to matrix now - #repaint-io_maven-tiles:gitter.im - or you could find me on Discord (taliosnz) or twitter (@talios) - or mastodon - @[email protected]

@talios
Copy link
Member

talios commented Oct 17, 2023

I've resurrected the github pages with new docs at https://repaint-io.github.io/maven-tiles - this is currently sitting on a feature branch and hope to flesh out some more docs shortly.

At the moment it's basically the README reworded/and chunked up.

@lfvjimisola
Copy link
Author

Great. Our are incorporating Maven Tiles now. We could give feedback here on what we think would be useful to add if that is of interest.

An up-to-date example/demo project, ready to clone, would of course be useful.

@talios
Copy link
Member

talios commented Nov 20, 2023

I've finally merged/setup Astro Starlight docs at https://repaint-io.github.io/maven-tiles and plan to add a bunch of example tiles, first off the deck will be a release tile based on recent changes/fixes with dependencyManagement.

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

No branches or pull requests

2 participants