Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update assembly + deployment to sonatype

  • Loading branch information...
commit e9060236701c3a97f5bba4c0b304f7211b45ee11 1 parent 1251b2a
@Tibor17 authored
View
45 junit.mavenize/Makefile
@@ -6,14 +6,24 @@
MVN_BIN=$(MVN_DIR)-$(MVN_BIN_EXT)
MVN_URL=$(MVN_BIN_URL)/$(MVN_BIN)
MVN_LOG=$(ROOT)/mvn.log
+ MVN_ARGS= #--log-file $(MVN_LOG)
M2_HOME=$(ROOT)/build/maven/$(MVN_DIR)
M2=$(M2_HOME)/bin
#export PATH=$M2:$PATH
export MAVEN_OPTS=-Xms16m -Xmx128m -Dfile.encoding=ISO-8859-1
+
+#.PHONY: configure
-all: configure release clean compile test install deploy
+# target: all - Default target.
+#git checkout KentBeck src/main/java/junit/runner/Version.java
+all: configure clean release deploy
+
+# target: help - Display callable targets.
+help:
+ egrep "^# target:" [Mm]akefile
+
+# target: configure - Configure build process.
configure:
- echo ${user}; \
if [ ! -d $(ROOT)/build/maven/$(MVN_DIR) ] ;then \
@cd $(ROOT)/build/maven; wget $(MVN_URL); \
cd $(ROOT)/build/maven; tar xvzf $(MVN_BIN); \
@@ -22,24 +32,39 @@ configure:
cd $(ROOT); \
fi; \
cd $(ROOT); touch $(MVN_LOG); \
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 --batch-mode --version; \
+ #echo -n "Enter branch name : "; read BRANCH;
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 --batch-mode --version $(MVN_ARGS); \
cd $(ROOT)
+
+# target: clean - Cleanup target dir.
clean:
cd $(ROOT); touch $(MVN_LOG); \
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 --batch-mode --errors clean; \ #--log-file $(MVN_LOG)
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 --batch-mode --errors $(MVN_ARGS) -f pom.xml clean; \
cd $(ROOT)
+
+# target: compile - Compiles (if necessary) without installing artifacts.
compile:
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 -DskipTests=true --batch-mode --errors compile; \
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 -DskipTests=true --batch-mode --errors $(MVN_ARGS) -f pom.xml compile; \
cd $(ROOT)
+
+# target: test - Tests without compilation.
test:
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 --batch-mode --errors test; \
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 --batch-mode --errors $(MVN_ARGS) -f pom.xml test; \
cd $(ROOT)
+
+# target: release - Prompts the user to modify *-SNAPSHOT version to a new release, and updates junit.runner.Version#id().
release:
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 -DskipTests=true --errors release:update-versions; \
+ #git checkout KentBeck pom.xml
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 -DskipTests=true --errors $(MVN_ARGS) -f pom.xml release:update-versions; \
cd $(ROOT)
+
+# target: install - Installs (and compiles if necessary) the artifacts to local repository.
install:
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 -DskipTests=true --batch-mode --errors javadoc:javadoc javadoc:jar install; \
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 -DskipTests=true --batch-mode --errors $(MVN_ARGS) -f pom.xml install; \
cd $(ROOT)
+
+# target: deploy - Deploys to remote repository Maven central and Sourceforge.
deploy:
- cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=./build/maven/.m2 -DskipTests=true --errors -f pom.xml -s src/main/config/settings.xml gpg:sign-and-deploy-file; \
- cd $(ROOT)
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 $(MVN_ARGS) --errors -f pom.xml -s src/main/config/settings.xml install; \# use deploy
+ cd $(ROOT); exec $(M2)/mvn -Dmaven.repo.local=build/maven/.m2 -DskipTests=true $(MVN_ARGS) --errors -f pom.xml -s src/main/config/settings.xml gpg:sign-and-deploy-file; \#
+ cd $(ROOT)
View
109 junit.mavenize/pom.xml
@@ -4,7 +4,7 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.10-SNAPSHOT</version>
+ <version>4.x-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>JUnit</name>
@@ -14,7 +14,7 @@
<name>JUnit</name>
<url>http://www.junit.org</url>
</organization>
- <inceptionYear>2002</inceptionYear>
+ <inceptionYear>2002</inceptionYear>
<mailingLists>
<mailingList>
<name>JUnit Mailing List</name>
@@ -44,41 +44,88 @@
<properties>
<hamcrestVersion>1.3</hamcrestVersion>
<jdkVersion>1.5</jdkVersion>
+ <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
<prerequisites>
<maven>3.0.4</maven>
</prerequisites>
<build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>LICENSE</include>
+ </includes>
+ </resource>
+ </resources>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
- <version>1.0-beta-6</version>
+ <version>2.2</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
- <version>1.0-beta-6</version>
- </extension>
- <extension>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-webdav</artifactId>
- <version>1.0-beta-2</version>
+ <version>2.2</version>
</extension>
</extensions>
<plugins>
+ <!--
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <version>1.0-beta-4-SNAPSHOT</version>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <overwrite>true</overwrite>
+ <outputDirectory>target</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.sourceDirectory}/junit/runner</directory>
+ <includes>
+ <include>Version.java</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>copy-version-file</id>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target name="update version">
+ <move file="${project.build.directory}/Version.java" tofile="${project.build.sourceDirectory}/junit/runner/Version.java" overwrite="true" failonerror="true" />
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ <plugin><!-- Using jdk 1.5.0_22, package-info.java files are compiled correctly. -->
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
- <encoding>ISO-8859-1</encoding>
+ <encoding>${project.build.sourceEncoding}</encoding>
<source>${jdkVersion}</source>
<target>${jdkVersion}</target>
+ <debug>true</debug>
+ <fork>true</fork>
+ <compilerArgument>-Xlint:unchecked</compilerArgument>
+ <maxmem>128m</maxmem>
</configuration>
</plugin>
<plugin>
@@ -109,8 +156,31 @@
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
+ <!-- import version without user's prompt if non-empty property value; otherwise prompt -->
+ <!--
+ <configuration>
+ <developmentVersion>${developmentVersion}</developmentVersion>
+ </configuration>
+ -->
</plugin>
<plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <executions>
+ <execution>
+ <phase>install</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/src.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2</version>
<executions>
@@ -139,7 +209,14 @@
<show>protected</show>
<author>false</author>
<version>false</version>
+ <detectLinks>false</detectLinks>
+ <linksource>true</linksource>
+ <keywords>true</keywords>
+ <use>true</use>
<windowtitle>JUnit API</windowtitle>
+ <encoding>UTF-8</encoding>
+ <locale>en</locale>
+ <javadocVersion>1.5</javadocVersion>
<javaApiLinks>
<property>
<name>api_1.5</name>
@@ -151,6 +228,10 @@
<minmemory>32m</minmemory>
<maxmemory>128m</maxmemory>
<failOnError>true</failOnError>
+ <includeDependencySources>true</includeDependencySources>
+ <dependencySourceIncludes>
+ <dependencySourceInclude>org.hamcrest:hamcrest-core:*</dependencySourceInclude>
+ </dependencySourceIncludes>
</configuration>
</execution>
</executions>
@@ -160,7 +241,7 @@
<version>1.4</version>
<configuration>
<repositoryId>sonatype-nexus-staging</repositoryId>
- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<uniqueVersion>false</uniqueVersion>
<updateReleaseInfo>true</updateReleaseInfo>
<file>${project.build.directory}/${project.build.finalName}.jar</file>
View
63 junit.mavenize/src/main/assembly/src.xml
@@ -0,0 +1,63 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>assembly</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>LICENSE</include>
+ <include>cpl-v10.html</include>
+ <include>README.html</include>
+ <include>BUILDING</include>
+ <include>build.xml</include>
+ <include>pom.xml</include>
+ <include>pom-dep.xml</include>
+ </includes>
+ <lineEnding>unix</lineEnding>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
+ <directory>target/apidocs</directory>
+ <outputDirectory>javadoc</outputDirectory>
+ <includes>
+ <include>*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>doc</directory>
+ <outputDirectory>doc</outputDirectory>
+ <includes>
+ <include>*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>junit-*.jar</include>
+ <include>junit-*-sources.jar</include>
+ <include>junit-dep-*.jar</include>
+ </includes>
+ <excludes>
+ <exclude>junit-*-javadoc.jar</exclude>
+ <exclude>junit-*-test-sources.jar</exclude>
+ <exclude>junit-dep-*-sources.jar</exclude>
+ <exclude>junit-dep-*-test-sources.jar</exclude>
+ <exclude>junit-dep-*-javadoc.jar</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+ <!--
+ <dependencySets>
+ <dependencySet>
+ <includes>
+ <include>hamcrest:*</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+ -->
+</assembly>
View
40 junit.mavenize/src/main/java/junit/runner/Version.java
@@ -0,0 +1,40 @@
+package junit.runner;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * This class defines the current version of JUnit
+ */
+public class Version {
+ private static final String VERSION;
+ static {
+ final Properties properties= new Properties();
+ try {
+ final ClassLoader classLoader = Version.class.getClassLoader();
+ InputStream pomProps= getPomPropertiesAsStream(classLoader, "junit");
+ if (pomProps == null) pomProps = getPomPropertiesAsStream(classLoader, "junit-dep");
+ if (pomProps != null) properties.load(pomProps);
+ VERSION= properties.getProperty("version", "<version>");
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ private static InputStream getPomPropertiesAsStream(ClassLoader cl, String artifactId) {
+ return cl.getResourceAsStream("META-INF/maven/junit/" + artifactId + "/pom.properties");
+ }
+
+ private Version() {
+ // don't instantiate
+ }
+
+ public static String id() {
+ return VERSION;
+ }
+
+ public static void main(String[] args) {
+ System.out.println(id());
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.