peter-lawrey / Java-Thread-Affinity

Control thread affinity for Java
379 stars 77 forks source link

pom.xml enchancements #3

Closed cheremin closed 12 years ago

cheremin commented 12 years ago
  1. Sources/resources encoding are not specified -- which is not portable, since it means "use system default" -> Added project.build.sourceEncoding=UTF-8
  2. Added <license>, <scm>, <distributionManagement> sections
  3. Added maven-antrun plugin to call chmod u+x Makefile
  4. Added maven deployment plugins. For now you should be able to create all standard maven artifacts (jar/javadoc/sources) and install them into your own public available repository <svn-path>/repo by invoking 'mvn deploy'. I can't check it, though, since I haven't write access.
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2011 Peter Lawrey
  ~
  ~ 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 License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>vanilla.java</groupId>
    <artifactId>affinity</artifactId>
    <version>1.1</version>
    <packaging>jar</packaging>

    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <comments>A business-friendly OSS license</comments>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:svn:https://github.com/peter-lawrey/Java-Thread-Affinity.git/trunk</connection>
        <developerConnection>scm:svn:https://github.com/peter-lawrey/Java-Thread-Affinity.git/trunk</developerConnection>
        <url>https://github.com/peter-lawrey/Java-Thread-Affinity</url>
    </scm>

    <distributionManagement>
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>github</id>
            <url>svn:https://github.com/peter-lawrey/Java-Thread-Affinity.git/repo/</url>
        </repository>
    </distributionManagement>

    <properties>
        <native.source.dir>src/main/c</native.source.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
        <!-- on linux install with sudo apt-get install libjna-java -->
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>3.4.0</version>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <groupId>org.jvnet.wagon-svn</groupId>
                <artifactId>wagon-svn</artifactId>
                <version>1.8</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>build-native</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="makefile" value="${project.basedir}/${native.source.dir}/Makefile"/>
                                <!-- make it executable -->
                                <chmod file="${makefile}" perm="u+x"/>
                            </target>
                        </configuration>

                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <!-- this execution happens just after compiling the java classes, and builds the native code. -->
                        <id>build-native</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>src/main/c/Makefile</executable>
                            <workingDirectory>src/main/c</workingDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>javadoc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-RequiredExecutionEnvironment>J2SE-1.5,JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>${project.groupId}.*;version="${project.version}"</Export-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
peter-lawrey commented 12 years ago

I have updated this file. You should be able to fork the code, and issue a pull request. (i.e. a request for me to accept your changes)

cheremin commented 12 years ago

Thank you. I'm not familar with DVCS yet, so it takes some time to jump in

peter-lawrey commented 12 years ago

GIT takes a bit to get your head around. I suggest adding a line to the README file to see if I can accept you changes.

peter-lawrey commented 12 years ago

You can add yourself to the list of Contributes. ;)