]> source.dussan.org Git - vaadin-framework.git/commitdiff
Snapshot deployment to Maven now works (#9299)
authorArtur Signell <artur@vaadin.com>
Wed, 5 Sep 2012 12:05:37 +0000 (15:05 +0300)
committerArtur Signell <artur@vaadin.com>
Sun, 9 Sep 2012 08:23:26 +0000 (11:23 +0300)
client-compiler/ivy.xml
common.xml
gwt-files.xml [changed mode: 0755->0644]
ivysettings-publish.xml
publish.xml
theme-compiler/ivy.xml

index d824f503b258e8dfe2e29a2f7e82c82a837ff923..eadf68e1c3f5795718b34cfb977f887c4b51ccd6 100644 (file)
     </publications>
     <dependencies>
         <dependency org="com.vaadin" name="vaadin-shared"
-            rev="${vaadin.version}"></dependency>
+            rev="${vaadin.version}" conf="build" />
         <dependency org="com.vaadin" name="vaadin-server"
-            rev="${vaadin.version}"></dependency>
+            rev="${vaadin.version}" conf="build" />
         <dependency org="com.vaadin" name="vaadin-client"
-            rev="${vaadin.version}"></dependency>
+            rev="${vaadin.version}" conf="build" />
+        <dependency org="commons-collections" name="commons-collections"
+            rev="3.1" conf="build,ide -> default" />
+
     </dependencies>
 
 </ivy-module>
index efaf47d30de649828acc87bcf6e218d075d0327c..5ea1a1314bd0eacb8295bcdd5d6c21c20abb85fb 100644 (file)
        <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="taskdefs.classpath" />
 
        <!-- FIXME These are not available in other files -->
-       <antcontrib:propertyregex property="vaadin.version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1" />
-       <antcontrib:propertyregex property="vaadin.version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2" />
-       <antcontrib:propertyregex property="vaadin.version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3" />
-
+       <antcontrib:propertyregex property="vaadin.version.major" input="${vaadin.version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1" />
+       <antcontrib:propertyregex property="vaadin.version.minor" input="${vaadin.version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2" />
+       <antcontrib:propertyregex property="vaadin.version.revision" input="${vaadin.version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3" />
        <ivy:settings file="${vaadin.basedir}/ivysettings.xml" id="ivysettings" />
 
        <union id="empty.reference" />
        </fileset>
 
 
-       <target name="pom.xml" description="Generates a pom.xml based on the Ivy configuration">
+       <target name="pom.xml" description="Generates a pom.xml based on the Ivy configuration. Either for a snapshot or a release version" depends="pom.xml.release,pom.xml.snapshot">
+       </target>
+
+       <target name="pom.xml.release" if="build.release">
                <fail unless="result.dir" message="No result.dir parameter given" />
                <property name="ivy.xml" location="${result.dir}/../ivy.xml" />
                <property name="pom.xml" location="${result.dir}/lib/${module.name}-${vaadin.version}.pom" />
                <property name="conf" value="build, build-provided" />
-               <property name="vaadin.maven.version" value="${vaadin.version.major}.${vaadin.version.minor}-SNAPSHOT" />
+               <property name="vaadin.maven.version" value="${vaadin.version}" />
 
                <ivy:makepom templatefile="${vaadin.basedir}/pom-template.xml" ivyfile="${ivy.xml}" pomfile="${pom.xml}" conf="${conf}">
                        <mapping conf="build" scope="compile" />
                </ivy:makepom>
        </target>
 
+       <target name="pom.xml.snapshot" unless="build.release">
+               <fail unless="result.dir" message="No result.dir parameter given" />
+               <property name="ivy.xml" location="${result.dir}/../ivy.xml" />
+               <property name="pom.xml" location="${result.dir}/lib/${module.name}-${vaadin.version}.pom" />
+               <property name="temp.pom.xml" location="${pom.xml}.temp" />
+               <property name="conf" value="build, build-provided" />
+               <property name="vaadin.maven.version" value="${vaadin.version.major}.${vaadin.version.minor}-SNAPSHOT" />
+
+               <ivy:makepom templatefile="${vaadin.basedir}/pom-template.xml" ivyfile="${ivy.xml}" pomfile="${temp.pom.xml}" conf="${conf}">
+                       <mapping conf="build" scope="compile" />
+                       <mapping conf="build-provided" scope="provided" />
+               </ivy:makepom>
+               <copy file="${temp.pom.xml}" tofile="${pom.xml}">
+                       <filterchain>
+                               <replacestring from="${vaadin.version}" to="${vaadin.maven.version}" />
+                       </filterchain>
+               </copy>
+               <delete file="${temp.pom.xml}" />
+       </target>
+
 
        <target name="sources.jar" depends="compile">
                <fail unless="result.dir" message="No result.dir parameter given" />
old mode 100755 (executable)
new mode 100644 (file)
index 69856447c08cf3e6aebac0f48a17d25b292a2b29..4f96b16b72342087b248fe98d37697f249ecf902 100644 (file)
@@ -5,6 +5,9 @@
     <credentials host="oss.sonatype.org" realm="Sonatype Nexus Repository Manager"
         username="${sonatype.username}" passwd="${sonatype.password}">
     </credentials>
+    <signers>
+        <pgp name="gpg" password="${gpg.passphrase}" />
+    </signers>
     <resolvers>
         <!-- user="${publish.sftp.user}" host="${publish.sftp.host}" keyFile="${publish.sftp.keyfile}" 
             keyFilePassword="${publish.sftp.keyfilepassword}" -->
@@ -12,7 +15,7 @@
             <ivy pattern="${publish.sftp.ivy.pattern}" />
             <artifact pattern="${publish.sftp.artifact.pattern}" />
         </sftp>
-        <ibiblio name="sonatype"
+        <ibiblio name="sonatype" signer="gpg"
             root="https://oss.sonatype.org/content/repositories/vaadin-snapshots/"
             m2compatible="true" />
 
@@ -20,7 +23,7 @@
             <ivy
                 pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/ivy-[revision].xml" />
             <artifact
-                pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision].[ext]" />
+                pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision](-[classifier]).[ext]" />
         </filesystem>
     </resolvers>
 
index c1b272f6e9a1e3b5b1cc547ef9ee4ba2029bbcf5..33df019a2538958dd7b7a8f9a898617aa2627f43 100644 (file)
@@ -2,6 +2,10 @@
 <project name="publish" basedir="." default="" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
        <include file="common.xml" as="common" />
        <include file="build.xml" as="vaadin" />
+
+       <!-- Dummy value as ivysettings-publish require a value  -->
+       <property name="publish.sftp.keyfile" value="/dummy" />
+
        <ivy:settings file="ivysettings.xml" />
        <ivy:settings file="ivysettings-publish.xml" id="publish.settings" />
        <property name="modules.to.publish" value="shared,server,client,client-compiler,client-compiled,theme-compiler,themes-compiled" />
        <fail unless="ant-jsch.present" message="Please install ant-jsch.jar into ANT_HOME/lib" />
        <fail unless="jsch.present" message="Please install jsch.jar into ANT_HOME/lib" />
 
-       <!--    <ivy:resolve organisation="com.vaadin" />-->
-       <!--<property name="local.temp" location="result/publish.temp" />-->
-
-
-       <ivy:cachepath inline="true" organisation="com.jcraft" module="jsch" revision="0.1.42" pathid="jsch.path" />
-       <ivy:cachepath inline="true" organisation="ant" module="ant-jsch" revision="1.6.5" pathid="jsch.task.path" />
-
-       <taskdef name="scp" classname="org.apache.tools.ant.taskdefs.optional.ssh.Scp">
-               <classpath refid="jsch.path" />
-               <classpath refid="jsch.task.path" />
-       </taskdef>
-
-       <!--
-       <target name="artifacts.to.local.temp">
-               <delete dir="${local.temp}" />
-               <copy todir="${local.temp}" flatten="true">
-                       <fileset dir="result/artifacts">
-                               <include name="**/vaadin-*.jar" />
-                               <include name="**/*.pom" />
-                               <exclude name="**/*buildhelper*" />
-                       </fileset>
-               </copy>
-       </target>
--->
-       <!--
        <target name="nightly.publish" depends="nightly.download.publish, nightly.maven.publish">
 
        </target>
-       -->
-       <target name="resolve.modules">
-               <!-- Find out a good build order -->
-               <ivy:buildlist reference="project.modules" excluderoot="true">
-                       <fileset dir="." includes="**/build.xml">
-                               <exclude name="build/**" />
-                       </fileset>
-               </ivy:buildlist>
-       </target>
 
        <!-- Copies the nightly build artifacts to the download server. -->
        <target name="nightly.tests.publish" if="nightly.tests.publish">
                <property name="file.war" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${version}.war" />
-
-               <!-- Publish to the demo server. -->
                <property name="target" value="${nightly.tests.publish}/${vaadin.version.major}.${vaadin.version.minor}-${build.tag}.war" />
 
                <echo>Installing ${src} to ${target}</echo>
 
-               <!-- Copy the linux installation package and the JAR. -->
-               <exec executable="scp" searchpath="true" resultproperty="nightly.demo.install.scp.result">
-                       <arg value="-B" />
-                       <arg value="${src}" />
-                       <arg value="${target}" />
-               </exec>
-
-               <echo>Result: ${nightly.install.scp.result}</echo>
-
+               <scp todir="${nightly.tests.publish}" file="${file.war}">
+               </scp>
        </target>
+
        <target name="nightly.download.publish">
                <antcontrib:foreach list="${modules.to.publish}" target="publish.module.to.download.site" param="module" />
        </target>
 
+       <target name="nightly.maven.publish">
+               <antcontrib:foreach list="${modules.to.publish}" target="publish.module.to.maven" param="module" />
+       </target>
+
        <target name="publish.module.to.download.site">
+               <fail unless="module" message="No module to publish defined" />
                <ivy:resolve file="${module}/ivy.xml" />
                <ivy:publish publishivy="false" settingsref="publish.settings" conf="*(public)" resolver="sftp-publish">
-                       <artifacts pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision](-[type]).[ext]" />
+                       <artifacts pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision](-[classifier]).[ext]" />
                </ivy:publish>
        </target>
 
-       <target name="nightly.maven.publish" if="maven.publish">
-               <antcall target="publish.module.to.maven">
-                       <param name="module" value="shared" />
-               </antcall>
-       </target
-       >
        <target name="publish.module.to.maven">
+               <fail unless="module" message="No module to publish defined" />
                <property file="${gpg.passphrase.file}" />
-               <ivy:resolve file="${module}/ivy.xml" />
-               <!--
-               <ivy:publish publishivy="false" settingsref="publish.settings" conf="*(public)" resolver="sonatype">
-                       <artifacts pattern="${ivy.settings.dir}/result/artifacts/[revision]/[module]/[artifact]-[revision](-[type]).[ext]" />
+
+               <!-- Ivy should be able to handle this but this does not work at the moment
+                               <ivy:resolve file="${module}/ivy.xml" />
+               <ivy:publish pubrevision="7.0-SNAPSHOT" publishivy="false" settingsref="publish.settings" conf="*(public)" resolver="sonatype">
+                       <artifacts pattern="${ivy.settings.dir}/result/artifacts/${vaadin.version}/[module]/[artifact]-${vaadin.version}(-[classifier]).[ext]" />
                </ivy:publish>
 -->
+               <property name="jar.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.jar" />
+               <property name="pom.file" location="result/artifacts/${vaadin.version}/vaadin-${module}/vaadin-${module}-${vaadin.version}.pom" />
 
                <artifact:mvn failonerror="true">
                        <arg value="gpg:sign-and-deploy-file" />
-                       <arg value="-e" />
-                       <sysproperty key="file" value="result/artifacts/7.0.0.test1/vaadin-shared/vaadin-shared-7.0.0.test1.jar" />
-                       <!--                    <sysproperty key="file" value="result/artifacts/*/${module}/" />-->
-                       <sysproperty key="pomFile" value="result/artifacts/7.0.0.test1/vaadin-shared/vaadin-shared-7.0.0.test1.pom" />
+                       <sysproperty key="file" value="${jar.file}" />
+                       <sysproperty key="pomFile" value="${pom.file}" />
                        <sysproperty key="repositoryId" value="${maven.snapshot.repository.id}" />
                        <sysproperty key="url" value="${maven.snapshot.repository.url}" />
                        <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
+                       <sysproperty key="retryFailedDeploymentCount" value="10" />
                </artifact:mvn>
-
        </target>
 
-       <!--<target name="nightly.download.publish" if="nightly.publish" depends="artifacts.to.local.temp">-->
-       <!-- Publish to the download server. -->
-       <!--            <fileset dir="${local.temp}" id="files.to.publish" />
-               <property name="files.string" refid="files.to.publish" />
-               <echo>Publishing ${files.string} to ${nightly.publish}</echo>
-               <scp todir="${nightly.publish}" trust="true" verbose="true">
-                       <fileset refid="files.to.publish" />
-               </scp>
-
-       </target>
-       -->
 </project>
\ No newline at end of file
index 873faa7a845b2e5a2762bfb6b89dee04135c9fd7..2a0e814c07cf3398dd07151419c81b69e63f16f6 100644 (file)
     <configurations>
         <conf name="build" />
         <conf name="build-provided" />
-        <conf name="ide" visibility="private"/>
+        <conf name="ide" visibility="private" />
         <conf name="tests" />
     </configurations>
     <publications>
-        <artifact type="jar" ext="jar"/>
-                <artifact type="pom" ext="pom"/>
-<artifact type="source" ext="jar" m:classifier="sources" />
-<artifact type="javadoc" ext="jar" m:classifier="javadoc" />
+        <artifact type="jar" ext="jar" />
+        <artifact type="pom" ext="pom" />
+        <artifact type="source" ext="jar" m:classifier="sources" />
+        <artifact type="javadoc" ext="jar" m:classifier="javadoc" />
     </publications>
     <dependencies defaultconf="*->default">
         <!-- LIBRARY DEPENDENCIES (compile time) -->