Browse Source

maven deployment script development

conversation
Mark Pollack 16 years ago
parent
commit
a80cb4f6e9
  1. 15
      build-spring-framework/generate-pom.xml
  2. 2
      build-spring-framework/package-bundle.xml
  3. 2
      build-spring-framework/package-library.xml
  4. 69
      build-spring-framework/publish-maven.xml
  5. 46
      build-spring-framework/publish.xml
  6. 73
      org.springframework.spring-library/pom.xml
  7. 13
      org.springframework.spring-parent/build.xml
  8. 10
      org.springframework.spring-parent/pom.xml

15
build-spring-framework/generate-pom.xml

@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
<path id="modules-to-process">
<!--
<pathelement location="../org.springframework.instrument"/>
<pathelement location="../org.springframework.instrument.classloading"/>
<pathelement location="../org.springframework.asm"/>
@ -26,22 +25,8 @@ @@ -26,22 +25,8 @@
<pathelement location="../org.springframework.web.servlet"/>
<pathelement location="../org.springframework.web.portlet"/>
<pathelement location="../org.springframework.test"/>
-->
<!--
<pathelement location="../org.springframework.integration-tests"/>
-->
</path>
<!--
<target name="create-poms" depends="clean,clean-integration,test"
description="Create a Maven pom for each module (use -Dbuild.stamp=m3-SNAPSHOT etc. to get the version number right).">
<all-bundles target="create-pom">
<property name="pom.output.file" value="pom.xml"/>
</all-bundles>
</target>
-->
<condition property="maven.extension" value=".bat" else="">
<os family="windows"/>
</condition>

2
build-spring-framework/package-bundle.xml

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="package-bundle">
<import file="publish-maven.xml"/>
<target name="package" depends="ivy.init">
<dist-jar/>
<src-jar/>

2
build-spring-framework/package-library.xml

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="package-library">
<import file="publish-maven.xml"/>
<target name="package" depends="ivy.init">
<dist-jar/>
</target>

69
build-spring-framework/publish-maven.xml

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="publish-maven-central-only-pom" xmlns:maven="antlib:org.apache.maven.artifact.ant">
<description>
This build file publishes to a maven repository and two ways.
1. Publish jar, source-jar, and pom artifacts.
2. Publish only the pom artifact.
The additional complexity in the implementation is due to a bug in the maven ant tasks version 2.0.8 that
prevents deploying to a local file repository on windows.
</description>
<condition property="is.windows" value="windows">
<os family="windows"/>
</condition>
<!-- top level targets -->
<target name="publish-maven-central-only-pom-artifacts" depends="publish-only-pom-windows,publish-only-pom-unix">
</target>
<target name="publish-maven-central-code-artifacts" depends="publish-code-windows,publish-code-unix">
</target>
<!-- Supporting targets -->
<!-- POM only deployment -->
<target name="publish-only-pom-windows" depends="maven.init" if="is.windows">
<maven:deploy>
<!-- Due to http://jira.codehaus.org/browse/MANTTASKS-103 in 2.0.8 on windows, fixed in 2.0.9 -->
<!-- Assuming using local file, value of variable should be of the form L:\temp\maven-repo-test -->
<remoteRepository id="localDisk" url="file:${maven.central.repository}"/>
<pom file="${local.pom.output.file}"/>
</maven:deploy>
</target>
<target name="publish-only-pom-unix" depends="maven.init" unless="is.windows">
<maven:deploy>
<remoteRepository url="${maven.central.repository}"/>
<pom file="${local.pom.output.file}"/>
</maven:deploy>
</target>
<!-- jar, source-jar and POM deployment -->
<target name="publish-code-windows" depends="maven.init">
<maven:deploy file="${jar.output.file}">
<!-- Due to http://jira.codehaus.org/browse/MANTTASKS-103 in 2.0.8 on windows, fixed in 2.0.9 -->
<!-- Assuming using local file, value of variable should be of the form L:\temp\maven-repo-test -->
<remoteRepository id="localDisk" url="file:${maven.central.repository}"/>
<pom file="${local.pom.output.file}"/>
<attach file="${source-jar.output.file}" classifier="sources"/>
</maven:deploy>
</target>
<target name="publish-code-unix" depends="maven.init" unless="is.windows">
<maven:deploy file="${jar.output.file}">
<remoteRepository url="${maven.central.repository}"/>
<pom file="${local.pom.output.file}"/>
<attach file="${source-jar.output.file}" classifier="sources"/>
</maven:deploy>
</target>
</project>

46
build-spring-framework/publish.xml

@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="publish-spring-framework" xmlns:maven="antlib:org.apache.maven.artifact.ant">
<property file="${basedir}/../build.properties"/>
<import file="${basedir}/../spring-build/multi-bundle/default.xml"/>
<path id="modules-with-code-artifacts">
<pathelement location="../org.springframework.instrument"/>
<pathelement location="../org.springframework.instrument.classloading"/>
<pathelement location="../org.springframework.asm"/>
<pathelement location="../org.springframework.core"/>
<pathelement location="../org.springframework.expression"/>
<pathelement location="../org.springframework.beans"/>
<pathelement location="../org.springframework.aop"/>
<pathelement location="../org.springframework.context"/>
<pathelement location="../org.springframework.transaction"/>
<pathelement location="../org.springframework.oxm"/>
<pathelement location="../org.springframework.jms"/>
<pathelement location="../org.springframework.aspects"/>
<pathelement location="../org.springframework.jdbc"/>
<pathelement location="../org.springframework.web"/>
<pathelement location="../org.springframework.orm"/>
<pathelement location="../org.springframework.context.support"/>
<pathelement location="../org.springframework.web.servlet"/>
<pathelement location="../org.springframework.web.portlet"/>
<pathelement location="../org.springframework.test"/>
</path>
<path id="modules-with-only-pom-artifacts">
<pathelement location="../org.springframework.spring-library"/>
<pathelement location="../org.springframework.spring-parent"/>
</path>
<target name="publish-maven-central-spring" depends="publish-maven-central-only-pom-spring">
<all-bundles target="publish-maven-central-code-artifacts" buildpathRef="modules-with-code-artifacts"/>
</target>
<target name="publish-maven-central-only-pom-spring">
<all-bundles target="publish-maven-central-only-pom-artifacts" buildpathRef="modules-with-only-pom-artifacts"/>
</target>
</project>

73
org.springframework.spring-library/pom.xml

@ -0,0 +1,73 @@ @@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Framework</name>
<modules>
<module>../org.springframework.spring-parent</module>
<module>../org.springframework.instrument</module>
<module>../org.springframework.instrument.classloading</module>
<module>../org.springframework.asm</module>
<module>../org.springframework.core</module>
<module>../org.springframework.expression</module>
<module>../org.springframework.core</module>
<module>../org.springframework.beans</module>
<module>../org.springframework.aop</module>
<module>../org.springframework.context</module>
<module>../org.springframework.transaction</module>
<module>../org.springframework.oxm</module>
<module>../org.springframework.jms</module>
<module>../org.springframework.aspects</module>
<module>../org.springframework.jdbc</module>
<module>../org.springframework.web</module>
<module>../org.springframework.orm</module>
<module>../org.springframework.context.support</module>
<module>../org.springframework.web.portlet</module>
<module>../org.springframework.web.servlet</module>
<module>../org.springframework.test</module>
</modules>
<url>http://www.springframework.org</url>
<organization>
<name>SpringSource</name>
<url>http://www.springsource.com</url>
</organization>
<description>Spring Framework</description>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<profiles>
<profile>
<id>staging</id>
<distributionManagement>
<site>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
</site>
<repository>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
</repository>
<snapshotRepository>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
</project>

13
org.springframework.spring-parent/build.xml

@ -5,17 +5,4 @@ @@ -5,17 +5,4 @@
<import file="${basedir}/../spring-build/library/default.xml"/>
<target name="publish-maven-central-pom-only" depends="maven.init">
<maven:deploy>
<remoteRepository url="${maven.central.repository}"/>
<!-- Due to http://jira.codehaus.org/browse/MANTTASKS-103 in 2.0.8 on windows, fixed in 2.0.9 -->
<!-- e.g. file:L:\temp\maven-repo-test -->
<!--
<remoteRepository id="localDisk" url="file:${maven.local.staging.repository}"/>
-->
<pom file="${local.pom.output.file}"/>
</maven:deploy>
</target>
</project>

10
org.springframework.spring-parent/pom.xml

@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
<groupId>org.springframework</groupId>
<artifactId>spring-parent</artifactId>
<packaging>pom</packaging>
<name>Spring Framework</name>
<name>Spring Framework Parent</name>
<version>3.0.0.BUILD-SNAPSHOT</version>
<description>Spring Framework</description>
<description>Spring Framework Parent</description>
<repositories>
@ -98,15 +98,15 @@ @@ -98,15 +98,15 @@
<distributionManagement>
<site>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
<url>file:${maven.local.staging.repository}</url>
</site>
<repository>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
<url>file:${maven.local.staging.repository}</url>
</repository>
<snapshotRepository>
<id>staging</id>
<url>file:${maven.local.staging.repository}</url>
<url>file:${maven.local.staging.repository}</url>
</snapshotRepository>
</distributionManagement>
</profile>

Loading…
Cancel
Save