Skip to content

Instantly share code, notes, and snippets.

View khmarbaise's full-sized avatar

Karl Heinz Marbaise khmarbaise

View GitHub Profile
@khmarbaise
khmarbaise / Author.java
Created November 2, 2024 13:19
Book Example / Record usage
package com.soebes.code.example.book;
public record Author(String name){
public Author {
name = NonBlankString.of(name, "author").value();
}
}

Keybase proof

I hereby claim:

  • I am khmarbaise on github.
  • I am khmarbaise (https://keybase.io/khmarbaise) on keybase.
  • I have a public key ASD25_TPJyZuXSxgnPANGE9b2FWNG-7ROWmiTwwL0bv8bQo

To claim this, I am signing this object:

Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
Maven home: /Users/khmarbaise/tools/maven
Java version: 13.0.1, vendor: AdoptOpenJDK, runtime: /Users/khmarbaise/tools/jdk-13.0.1+9/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
xxx$ mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< wtf.g4s8:oot >----------------------------
[INFO] Building oot 1.0-SNAPSHOT
@khmarbaise
khmarbaise / Error output
Created October 9, 2016 09:18
maven-artifact-transfer log output running mvn clean verify
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.154 sec <<< FAILURE! - in org.apache.maven.shared.project.install.ProjectInstallerTest
testShouldInstallSingleArtifact(org.apache.maven.shared.project.install.ProjectInstallerTest) Time elapsed: 0.154 sec <<< ERROR!
org.apache.maven.shared.artifact.install.ArtifactInstallerException:
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: org.apache.maven.shared.artifact.install.internal.Maven31ArtifactInstaller
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.shared.artifact.install.ArtifactInstaller annotated with @com.google.inject.name.Named(value=maven31)
@khmarbaise
khmarbaise / pom.xml
Created October 9, 2016 09:16
maven-artifact-transfer pom.xml
<?xml version='1.0' encoding='UTF-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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
package org.apache.maven.artifact.versioning;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
@khmarbaise
khmarbaise / ProjectInstallerTest.java
Last active September 24, 2016 09:14
Test for writing a Unit Test for maven-artifact-transfer comopnent.
package org.apache.maven.shared.project.install;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.util.List;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFile;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.command.status.StatusScmResult;
import org.apache.maven.scm.manager.NoSuchScmProviderException;
@khmarbaise
khmarbaise / gist:5473941
Created April 27, 2013 17:49
Problem during integration tests with maven-3.1.0-alpha-1 (https://github.com/khmarbaise/build-metadata-maven-plugin)
Apache Maven 3.1.0-alpha-1 (262b9bb1ef91d1414e5162d9dd0f5522e7186202; 2013-03-30 22:38:49+0100)
Maven home: /usr/share/java/apache-maven-3.1.0-alpha-1
Java version: 1.6.0_26, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.5.8", arch: "x86_64", family: "mac"[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/java/apache-maven-3.1.0-alpha-1/conf/settings.xml
[DEBUG] Reading user settings from /Users/km/ws-git/build-metadata-maven-plugin/target/it/interpolated-settings.xml
[DEBUG] Using local repository at /Users/km/ws-git/build-metadata-maven-plugin/target/local-repo
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/km/ws-git/build-metadata-maven-plugin/target/local-repo
@khmarbaise
khmarbaise / ConfiguratorMojo.java
Created November 21, 2012 10:19
Own Maven resource filtering plugin
@Mojo(name = "configurator", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresProject = true)
public class ConfiguratorMojo extends AbstractMojo {
@Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}")
protected String encoding;
/**
* The current Maven project.
*/
@Component