Giter Club home page Giter Club logo

library-maven-archetype's Introduction

Library Maven Archetype

A Maven Archetype for generating new Maven-based libraries, fully prepared to take advantage of a CI process.

While it can be prepared for any CI service, it is prepared for Github Workflow. Acquiring the code from a Github repository and publishing into OSS Sonatype or Github packages.

After running all the tests artifacts will be published into this repository, but the new project will be able to generate and publish also a Maven site, which, thanks to the Docs Maven Skin, will show documentation and useful reports from Checkstyle, SpotBugs and similar tools.

The Archetype will do little more than take care of configuration, setting up the POM and the Maven project is most of its job, and so it will include few files not related to this. Some useful things such as a readme, a gitignore and a license files are included, but the initial code will consists just of a few placeholder classes.

Maven Central

Release docs Development docs

Features

  • Fully configured POM, extending from bernardomg's Base POM, including features such as build validation, changes report or manifest configuration.
  • Prepared for continuous integration with Github, Github Workflow and both OSS Sonatype and Github packages. Making a distinction between releases and development versions.
  • Prepared for unit and integration tests suites. Created with JUnit and ready to be run with Surefire and Failsafe.
  • A Maven site, using the Docs Maven Skin, for sharing the project's documentation along the Javadocs and various reports which range from code quality to changes log.
  • Includes basic files such as readme, gitignore and license.

Sample project

A sample project shows what this Archetype is capable of creating.

Usage

It is a Maven Archetype, so it has to be included in the local repository, and then can be used to create a new project through command line or an IDE.

All the published versions are in the Maven repository, but installing the archetype into the local repository is always an option.

Installing

The archetype will be installed with the following Maven coordinates:

Group ID: com.bernardomg.maven.archetypes
Artifact ID: library-archetype
Version: (Check POM or badges)

To use it through command line type the following:

mvn archetype:generate -DarchetypeGroupId=com.bernardomg.maven.archetypes -DarchetypeArtifactId=library-archetype -DarchetypeVersion=[version]

If using an IDE check its documentation to find out how to use Maven Archetypes, and how to add these to the local repository.

Changing JDK Version

By default the project will be set for JDK 11. If this needs to be changed, for example to make use of JDK 17, the java.version property has to be overriden:

<properties>
   <java.version>17</java.version>
<\properties>

Documentation

Documentation is always generated for the latest release, kept in the 'master' branch:

Documentation is also generated from the latest snapshot, taken from the 'develop' branch:

The documentation site is actually a Maven site, and its sources are included in the project. If required it can be generated by using the following Maven command:

mvn verify site

The verify phase is required, otherwise some of the reports won't be generated.

Running tests

The archetype plugin comes ready to run integration tests for the archetype by using the usual Maven command:

mvn verify

Check the archetype testing goal for more info.

If using Eclipse the tests may not run, due to an incompatibility with the Maven Invoker library. It is recommender running the tests through command line.

Collaborate

Any kind of help with the project will be well received, and there are two main ways to give such help:

  • Reporting errors and asking for extensions through the issues management
  • or forking the repository and extending the project

Issues management

Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.

Getting the code

If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the 'master' branch for the latest release, and the 'develop' for the current, and stable, development version.

License

The project has been released under the MIT License.

library-maven-archetype's People

Contributors

bernardo-mg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

library-maven-archetype's Issues

Set the year automatically

The year of creation for the project, used as the POM inception year and the license year, is currently hardcored. Instead it should be set automatically as the current year.

The profile for publishing the docs is not easy to extend

Currently the URL for publishing the release docs is on the default profile, with an alternative one for development docs.

This is not good, as the default profile may be needed for other things than publishing docs.

For example, when creating a web service the default profile would be for the deployment version, using a real database, in contrast to the testing profile, which would use an in-memory database. The current profiles would collide with this.

It may be better changing the current default profile to a "release docs profile", and making use of it when deploying the docs.

Allow skipping tests for deployment

The project is already tested by the CI service before deploying, so it should be possible skipping the tests so they are not run again for deploying artifacts.

Deployment scripts are not reusable

The deployment scripts make reference to the Travis branch variable, and to the pull variable. This should be changed so they can be used on othe CI services.

Prepare an archetypes repo

The releases would be more useful if they were stored ona an archetypes repo. One should be prepared for this.

Create an example project

An example project, created from the latest release, should be created, and added to a Github repository.

This way it is possible to see what this archetype is capable of doing,

Is the dependencies info needed?

The dependencies info section, on the project information reports, tells how to configure the dependencies.

This should be linked on the usage section, or removed.

.gitignore file is not copied

The .gitignore file is not copied on new projects using the archetype.

Seems to be a problem of the resources pluging. Changing from version 2.7 to 2.6 is supposed to solve it, but after trying it the bug persisted.

Error with accents

The archetype seems to be ignoring the UTF8 encoding in some parts of it, as the accents are not copied correctly.

Add support for circleci

circleci is another popular CI service. Prepare the artifact so newly generated projects may run on it.

Default route for the development docs site

The readme, and probably other places, are appending "/development" to the development documentation URL. This should not be required, instead it should be set on the default URL.

Change source and target JDK variables

Currently the java.version.source and java.version.target variables are being used, but the defaults are maven.compiler.source and maven.compiler.target.

Unable to deploy

For some reason, the deployment to Bintray is failing with a '500, internal server error'.

Deploy on tag, not on master

Maybe the artifact deployment should check if the code was pulled from a tag, not from the master branch.

This would allow reusing part of the scripts for other languages, and also would only try to do the final deployment when the user really wants to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.