Lambda in Angular (typescript)

Posted on by Kim

return books.bar.filter(function (x) {
  return x.id === null;
}).length;

change to

return books.bar.filters(b => b.id === null).length;

@Slf4j
@RequiredArgsConstructor
@Configuration
public class SslConfig {

    private final SslSettings sslSettings;

    @PostConstruct
    void init() {
        String truststore = sslSettings.getTruststore();
        if (truststore != null) {
            log.info("Setting truststore: {}", truststore);
            System.setProperty("javax.net.ssl.trustStore", truststore);
        } else if (System.getProperty("javax.net.ssl.trustStore") != null) {
            log.info("Using provided truststore: {}", System.getProperty("javax.net.ssl.trustStore"));
        } else {
            throw new IllegalStateException("No truststore found!");
        }
    }
}

Upload from Jenkinsfile to Artifactory (Declarative Pipeline)

Posted on by Kim

#!groovy

pipeline {
    agent any {

    stages {
        stage('Clone') {
            steps {
                echo 'Clone...'
                git branch: 'master'
                    credentialsId: 'jenkins-ssh',
                    url: 'ssh://git@bitbucket.ccc.net:7999/xxx/test.git'
            }
        }

        stage('Build')
            steps {
                echo 'Build...'
                script {
                    def server = Artifactory.server 'AFN' // Setup in Jenkins : Manage Jenkins -> Configure System -> Artifactory (Server ID)
                    def buildInfo = Artifactory.newBuildInfo()
                    buildInfo.env.capture = true
                    def rtMaven = Artifactory.newMavenBuild()
                    rtMaven.tool = 'M3' // Setup in Jenkins : 
                    rtMaven.deployer releaseRepo:'libs-release-local', snapshotRepo: 'libs-snapshot-local', server: server
                    rtMaven.resolver releaseRepo:'libs-release', snapshotRepo: 'libs-snapshot', server: server

                    rtMaven.run pom: 'pom.xml', goals: 'clean install', buildInfo: buildInfo

                    buildInfo.retention maxBuilds: 10, maxDays: 7, deleteBuildArtifacts: true
                    server.publishBuildInfo buildInfo
                }
            }
        }
    }
    post {
        success {
            archiveArtifacts artifacts: '**target/*.jar', fingerprint: true
        }
    }
}