Skip to content

MikAoJk/norwegian-organization-number-validator

Repository files navigation

norwegian-organization-number-validator

A simple validator for, validation a norwegian organization number

See brreg organisasjonsnummer for more info on how validation of a norwegian organization number is done

Build and test Validate Gradle Wrapper Build and publish artifact

Technologies used

  • Kotlin
  • Gradle
  • JDK 21

Using the library

import

Gradle(kotlin)

implementation("io.github.mikaojk:norwegian-organization-number-validator:2.0.4")

Maven

<dependency>
  <groupId>io.github.mikaojk</groupId>
  <artifactId>norwegian-organization-number-validator/artifactId>
  <version>2.0.4</version>
</dependency>

Use example

import io.github.mikaojk.validator.validNorwegianOrganizationNumber

val validOrganizationNumber = validNorwegianOrganizationNumber("810009152")
if (validOrganizationNumber) {
            println("Orgnumber is valid")
        } else {
            println("Orgnumber is invalid")
        }

Local development started

Prerequisites

Make sure you have the Java JDK 21 installed You can check which version you have installed using this command:

java -version

Running the application locally

Build and run tests

To build locally and run the integration tests you can simply run

./gradlew clean build

or on windows gradlew.bat clean build

Upgrading the gradle wrapper

Find the newest version of gradle here: https://gradle.org/releases/ Then run this command:

./gradlew wrapper --gradle-version $gradleVersjon

Manual publish

To publish you can simply run

./gradlew clean build

and then run

./gradlew publish

Publish of artifact

Artifact publish is done by GitHub Actions, and publish to Maven Central and GitHub Packages

This project uses semantic versioning and does NOT prefix tags or release titles with v i.e. use 1.2.3 instead of v1.2.3

see guide about how to relese:creating release GitHub

👥 Contact

This project is maintained by CODEOWNERS

Questions and/or feature requests? Please create an issue

✏️ Contributing

To get started, please fork the repo and checkout a new branch. See more info in CONTRIBUTING.md

About

Simple validator for validating norwegian organization numbers

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages