Coder Social home page Coder Social logo

properties-maven-extension's People

Contributors

dampfnudel avatar dependabot[bot] avatar pascalgn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

properties-maven-extension's Issues

Only running with Java 8

Unfortunately the extension will only run with JDK 8:

Failed to initialize spy com.github.pascalgn.maven.properties.EventSpyImpl: org/eclipse/jgit/lib/AnyObjectId : Unsupported major.minor version 52.0

Add git describe property

I have a need for the following git attributes:

  • git.describe = gives the same output as the git describe command.
  • git.closest.tag.name = the closest tag name
  • git.closest.tag.commit.count = the closest commit count

I have already implemented the code and would like to push it up as a feature branch for review but I'm not allowed to create a branch in this project.

git tag incorrect

Hi. Clearly no-one is using the git.tag.last property like I am.

The "last tag from sorted tag list (v1.2.3)" is not useful for builds, since it takes the latest tag, whether those tags apply to a commit on the branch or not.
In other words, currently, if I tag a commit on another branch, it will change the version number of my projects built on ALL OTHER BRANCHES.

So instead of

git tag -l | tail -1

The behaviour should resemble

git describe --abbrev=0

This will only show annotated tags, but I would prefer this as it allows developers to use normal tags for other things and leave the a-tags for version tagging.

New feature: Color names

The first 6 characters of a git commit id also happen to describe a color, in hex format. Together with tools like color-names, we can get a mapping in the form

c9c17d544ffa0096c12cc90673ea836cf3399561 -> Dried Moss

It will not be a unique mapping, but it can still helpful for continuous deployment scenarios, where "Currently we have Dried Moss deployed" might be easier than "Currently deployed version is c9c17d".

We could add additional properties, maybe something like this:

git.commit.color.value   # c9c17d
git.commit.color.name   # Dried Moss

determine worktree of the root project

The git.dir.worktree property should be determined from the location of the root project, not the working directory.
I found this using mvn --f . Its also applicable when using submodules.

get directories

I use the directory-maven-plugin to get the root directory of the reactor, which happens to be the repository workspace.

https://github.com/jdcasey/directory-maven-plugin#highest-basedir-goal

But due to the way plugins work, that execution runs in every project in the reactor, even though I only need it in the root project.

I could ask the author to provide an extension of his plugin, but I thought why not implement in this extension instead?

Read properties from properties source

Hi Pascal,

Is it conceivable for you that some of the properties are read in via any sources?

By the way:
At this second I don't know about maven extensions, but shouldn't maven complain about placeholders? 'version' contains an expression but should be a constant. @ com.acceo.stuff.abc:stuff-abc-parent:${MYPROJECT_VERSION}

Thanks
Torsten

alternative worktrees

I get error when I build from a directory I created as an alternative worktree git add worktree ../temp

[WARNING] Failed to initialize spy com.github.pascalgn.maven.properties.EventSpyImpl: Error while reading Git properties!
[INFO] Scanning for projects...
[ERROR] Internal error: java.lang.NullPointerException -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
    at java.util.Hashtable$Entry.setValue (Hashtable.java:1286)
    at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:1429)
    at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:1027)
    at org.apache.maven.model.interpolation.StringVisitorModelInterpolator$ModelVisitor.visit (StringVisitorModelInterpolator.java:170)
    at org.apache.maven.model.interpolation.StringVisitorModelInterpolator.interpolateModel (StringVisitorModelInterpolator.java:107)
    at org.apache.maven.model.building.DefaultModelBuilder.interpolateModel (DefaultModelBuilder.java:789)
    at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:393)
    at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:448)
    at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:414)
    at org.apache.maven.project.DefaultProjectBuilder.build (DefaultProjectBuilder.java:377)
    at org.apache.maven.graph.DefaultGraphBuilder.collectProjects (DefaultGraphBuilder.java:414)
    at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor (DefaultGraphBuilder.java:405)
    at org.apache.maven.graph.DefaultGraphBuilder.build (DefaultGraphBuilder.java:82)
    at org.apache.maven.DefaultMaven.buildGraph (DefaultMaven.java:507)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:219)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

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.