Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

########################################
# Java
########################################
[*.java]
indent_style = space
indent_size = 4
max_line_length = off

########################################
# XML (POM files, Spring XML, misc)
########################################
[*.xml]
indent_style = space
indent_size = 2

########################################
# JSON
########################################
[*.json]
indent_style = space
indent_size = 2

########################################
# YAML (docker-compose, GitHub actions, configs)
# YAML SHOULD NEVER USE TABS — many parsers reject them
########################################
[*.{yml,yaml}]
indent_style = space
indent_size = 2


########################################
# Markdown
# Keep indentation small; used mainly for lists and fenced blocks.
########################################
[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false # needed to preserve Markdown hard line breaks

########################################
# Properties files
# Key-value pairs; indenting rarely matters but 2 spaces is common.
########################################
[*.properties]
indent_style = space
indent_size = 2

########################################
# HTML (simple default)
########################################
[*.html]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eb7e29d5e4b012e89f277e7d275381bb1624669f
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# exense-commons

This project contains functionality reused across a variety of applications built internally at exense GmbH and is open for external collaboration purposes.
This project contains functionality reused across a variety of applications built internally at exense GmbH and is open
for external collaboration purposes.

## Instructions for developers

### Code formatting (indentation and line breaks)

Use an IDE that supports the `.editorconfig` standard and make sure that it is enabled. This will automatically
apply the recommended settings to all files.

### Git blame history

To ensure correct handling of "reformat-only" commits, use a recent git version (>= 2.23) with the following
configuration. You can do this per-repository (in that case, omit the `--global` flag), but the filename used
is a de-facto standard, and this way you'll only need to do this once, not for every repository:

```
git config --global blame.ignoreRevsFile .git-blame-ignore-revs
```
32 changes: 16 additions & 16 deletions build_parameters.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"ACTION": "COMPILE",
"TYPE": "POM",
"FOLDER": ".",
"PARAMETERS": [
{
"NAME": "DEVELOPMENT",
"URL": "nexus-staging::https://nexus-enterprise-staging.exense.ch/repository/staging-maven/",
"CONFIG": "SkipJavadoc"
},
{
"NAME": "PRODUCTION",
"URL": "sonatype::https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/",
"CONFIG": "SignedBuild"
}
]
}
"ACTION": "COMPILE",
"TYPE": "POM",
"FOLDER": ".",
"PARAMETERS": [
{
"NAME": "DEVELOPMENT",
"URL": "nexus-staging::https://nexus-enterprise-staging.exense.ch/repository/staging-maven/",
"CONFIG": "SkipJavadoc"
},
{
"NAME": "PRODUCTION",
"URL": "sonatype::https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/",
"CONFIG": "SignedBuild"
}
]
}
80 changes: 40 additions & 40 deletions exense-basic-commons/pom.xml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>exense-basic-commons</artifactId>
<packaging>jar</packaging>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>${project.groupId}:${project.artifactId}</name>

<parent>
<groupId>ch.exense.commons</groupId>
<artifactId>exense-commons</artifactId>
<version>0.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<artifactId>exense-basic-commons</artifactId>
<packaging>jar</packaging>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<name>${project.groupId}:${project.artifactId}</name>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<parent>
<groupId>ch.exense.commons</groupId>
<artifactId>exense-commons</artifactId>
<version>0.0.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright 2021 exense GmbH
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
Expand All @@ -24,31 +24,31 @@

public class ArgumentParser {

private HashMap<String, String> options = new HashMap<String, String>();
private Pattern p = Pattern.compile("-(.+?)(?:=(.+?))?$");

public ArgumentParser(String[] paramArrayOfString) {
Matcher localMatcher = null;
for (int i = 0; i < paramArrayOfString.length; i++) {
if (!(localMatcher = this.p.matcher(paramArrayOfString[i])).find())
continue;
this.options.put(localMatcher.group(1).toLowerCase(), localMatcher.group(2));
}
}

public boolean hasOption(String paramString) {
return this.options.containsKey(paramString.toLowerCase());
}

public String getOption(String paramString) {
return (String) this.options.get(paramString.toLowerCase());
}

public Set<Entry<String, String>> entrySet() {
return options.entrySet();
}

public Map<String, String> getOptions() {
return options;
}
private HashMap<String, String> options = new HashMap<String, String>();
private Pattern p = Pattern.compile("-(.+?)(?:=(.+?))?$");

public ArgumentParser(String[] paramArrayOfString) {
Matcher localMatcher = null;
for (int i = 0; i < paramArrayOfString.length; i++) {
if (!(localMatcher = this.p.matcher(paramArrayOfString[i])).find())
continue;
this.options.put(localMatcher.group(1).toLowerCase(), localMatcher.group(2));
}
}

public boolean hasOption(String paramString) {
return this.options.containsKey(paramString.toLowerCase());
}

public String getOption(String paramString) {
return (String) this.options.get(paramString.toLowerCase());
}

public Set<Entry<String, String>> entrySet() {
return options.entrySet();
}

public Map<String, String> getOptions() {
return options;
}
}
Loading