User Tools

Site Tools


public:javabestpractises

This is an old revision of the document!


Java Best Practises

These guidelines help our many different Java projects and libraries to work together.

GitHub Repository

For easier collaboration, visibility, backup and version control, please create a repository at https://github.com/AKSW. Please only create a public repository if possible, as the number of private ones is limited.

Maven

Maven 3 pom.xml template (change the compiler source to your liking):

<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>
    <groupid>org.aksw.projectname</groupid>
    <artifactid>projectname</artifactid>
    <version>0.0.1-SNAPSHOT</version>

    <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupid>junit</groupid>
            <artifactid>junit</artifactid>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupid>org.slf4j</groupid>
            <artifactid>slf4j-log4j12</artifactid>
            <version>1.7.13</version>
        </dependency>
        <dependency>
            <groupid>org.slf4j</groupid>
            <artifactid>slf4j-api</artifactid>
            <version>1.7.13</version>
        </dependency>
    </dependencies>
</project>

If you have a stable project, create a release (non-snapshot) version, as it decrease network traffic and increase speed tremendously.

Logging

SLF4j is a collection of interfaces for logger abstraction, which .

Encoding and Line Endings

Please always use UTF-8 encoding. Line endings will usually handled by git so that you can choose those as you prefer.

public/javabestpractises.1449488194.txt.gz · Last modified: 2015/12/07 12:36 by Konrad Hoeffner

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki