Class ValidateVersionMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="validate-version",
          defaultPhase=VALIDATE,
          threadSafe=true)
    public class ValidateVersionMojo
    extends AbstractVersionMojo
    Validates project Maven and OSGi versions. For SNAPSHOT versions, OSGi version qualifier must be ".qualifier" and unqualified Maven and OSGi versions must be equal. For RELEASE versions, OSGi and Maven versions must be equal.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean strictVersions
      If true (the default) will fail the build if Maven and OSGi project versions do not match.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • strictVersions

        @Parameter(defaultValue="true")
        private boolean strictVersions
        If true (the default) will fail the build if Maven and OSGi project versions do not match. If false will issue a warning but will not fail the build if Maven and OSGi project versions do not match.
    • Constructor Detail

      • ValidateVersionMojo

        public ValidateVersionMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • validateReleaseVersion

        public void validateReleaseVersion​(java.lang.String mavenVersion,
                                           java.lang.String osgiVersion)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getOSGiMetadataFileName

        private java.lang.String getOSGiMetadataFileName()
      • validateSnapshotVersion

        public void validateSnapshotVersion​(java.lang.String mavenVersion,
                                            java.lang.String osgiVersion)
                                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • fail

        private void fail​(java.lang.String message)
                   throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException