dev@jsftemplating.java.net

Re: JSFTemplating: Re: Publishing JSFTemplating jars in Maven Respository

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 23 Aug 2007 13:26:15 -0700

Hi Priti,

This is great!

1.0 is fine for now.  I think we'll use 1.2 to match up w/ the JSF version that it requires.  And yes, we should also add on auto-generated suffix like "_b##" to distinguish the build numbers.

It would be nice if we had a java-sources directory w/ the src also... but this isn't a high priority.  The other jars look good!

Let me talk w/ Senthil and others to see if we can work out the build numbers.  Feel free to join the IRC channel for the discussion on this.

Thank you!

Ken

Priti Tiwary wrote:
Hi Ken,
I was able to publish jars. You can check that they are now available at
http://download.java.net/maven/1/com.sun.jsftemplating/jars/

For this first publishing, i have used version 1.0. We will have to modify the 3 pom files and build.xml files besides any properties file to autogenerate the version info for next publishing, if we will use the cronjobs to publish jars periodically.

But before integrating the changes i wanted you to review files which i will be integrating.
We need to create 3 new poms , one each for jsftemplating, jsftempating-dt and jsftemplating-dynafaces-0.1 for each jar we want to publish.
I had to modify build.properties file to set two variable which i have used in the build.xml file. I have attached the context diffs of both these files for review besides the three poms.

We will have to download 1 jar maven-repository-importer-1.2.jar from the below website.
https://maven-repository.dev.java.net/nonav/repository/com.sun.wts.tools.mri/jars/
I have kept this jar in ${jsftemplatinghome}/lib/external directory and set this path in build.properties file.
If we plan to change the location to put this jar, build.properties file needs to be updated too
This jar should be in classpath (done in build.xml) to  use the corresponding  ant -task in  build script

Details on the steps on how the new ant task can be added to build scripts to push artifacts in maven repository can be found at
https://maven-repository-importer.dev.java.net/source/browse/*checkout*/maven-repository-importer/maven-repository-importer/doc/index.html

I have pushed artifacts from SOlaris machine using cvs 1.11.16 as my windows machines cvs (cvsnt 2.5.03 scorpio build 2260) was giving problem in importing jars.

I would appreciate if someone else with different cvs version on windows can try the same and ok the changes.

I observed few other projects (like jmaki and few others ) have three directories published (jars, java-sources, poms). Would you consider  having third directory too?

Let me know how should we go about version information and  if the contents of the published jars are what we  want.

Priti




Ken Paulsen wrote:

Hi Priti,

Thanks for looking into this!

A LONG time back I started looking into this and didn't get very far. :)  However, I did add the maven_repository user as an observer... so that is already done. :)

FYI, in case you didn't already notice we do have a nightly build system in place... if that can be of any help wrt publishing to the maven repository feel free to take advantage of that.  We may also want to ensure we have a proper version # in the META-INF directory of the jsft.jar file... let me know if you need any help with that.

Thank you!!

Ken

Priti Tiwary wrote:
Hi Ken,
In order to publish the JSFTemplating jars in Maven Repository we have to  first add "maven_repository" user as observer in the project.
Other steps include putting maven-repository-importer.jar in the project and writing targets to push the three jars in repository
If you add the user , i will send you the changes to build.xml files for review .
Priti



<project> <groupId>com.sun.jsftemplating</groupId> <artifactId>jsftemplating</artifactId> <version>@VERSION@</version> <name>Templating for Java Server Faces</name> </project>

<project> <groupId>com.sun.jsftemplating</groupId> <artifactId>jsftemplating-dt</artifactId> <version>@VERSION@</version> <name>JSFTemplating Design Time lib</name> </project>

<project> <groupId>com.sun.jsftemplating</groupId> <artifactId>jsftemplating-dynafaces-0.1</artifactId> <version>@VERSION@</version> <name>JSFTemplating Dynafaces support lib</name> </project>

## ## This is an example build.properties file, you should modify it to match ## your environment. It should be saved as file called "build.properties". ## ## NOTE to Windows Users: Use forward slashes (/) instead of back-slashes ## (\). For example: ## ## glassfish-home=C:/Sun/AppServer ## ## glassfish-home is the only variable you need to change if you are using ## GlassFish. glassfish-home is only used w/i this file, so if you don't have ## GlassFish, you only need to replace the references to GlassFish here. glassfish-home=/space0/gf-0908-pe/publish/glassfish servlet-api.jar=${glassfish-home}/lib/javaee.jar junit.jar=test/junit/junit.jar ## This is already available for GlassFish in javaee.jar jsf-api.jar= el-api.jar= ## You don't need to change these: aptbuild=aptbuild build=build dist=dist docs=docs lib=lib src=src/java test=test jsftemplating.jar=${dist}/jsftemplating.jar jsftemplating-dt.jar=${dist}/jsftemplating-dt.jar ## Dynamic Faces jar file for JSFTemplating jsftemplating-dynafaces.jar=${lib}/external/jsftemplating-dynafaces-0.1.jar maven-repository-importer.jar=${lib}/external/maven-repository-importer-1.2.jar java.net.user.name=ptsukla ## Woodstock specific jar files dataprovider.jar=lib/external/woodstock/dataprovider.jar jsftemplating.home=${src}/com/sun/jsftemplating compile.debug=true compile.optimize=false compile.deprecation=false #proxy.host= #proxy.port= #proxy.user= #proxy.pass=

Index: build.xml =================================================================== RCS file: /cvs/jsftemplating/build.xml,v retrieving revision 1.31 diff -c -r1.31 build.xml *** build.xml 7 Jun 2007 04:57:00 -0000 1.31 --- build.xml 23 Aug 2007 17:52:42 -0000 *************** *** 204,207 **** --- 204,236 ---- fileDescription="Nightly snapshot of the JSFTemplating DynaFaces support lib" overwrite="yes"/> </target> + <target name="push-to-maven-prepare"> + <taskdef resource="maven-repository-importer.properties"> + <classpath> + <pathelement path="${maven-repository-importer.jar}" /> + </classpath> + </taskdef> + <delete dir="${build}/maven-repo" /><!-- clean it --> + <maven-repository-importer destdir="build/maven-repo" version="1.0"> + <artifact jar="${dist}/jsftemplating.jar" pom="jsftemplating.pom"/> + <artifact jar="${dist}/jsftemplating-dt.jar" pom="jsftemplating-dt.pom" /> + <artifact jar="${dist}/jsftemplating-dynafaces-0.1.jar" pom="jsftemplating-dynafaces-0.1.pom" /> + </maven-repository-importer> + </target> + + <target name="push-to-maven" depends="push-to-maven-prepare"> + <!-- import to CVS--> + <tstamp /> + <echo>importing to CVS...</echo> + <cvs dest="${build}/maven-repo"> + <commandline> + <argument value="-d:pserver:${java.net.user.name}@cvs.dev.java.net:/cvs" /> + <argument line="-z9 import -ko -W *.jar -kb -m" /> + <argument value="deploying new jars to the java.net maven repository" /> + + <argument value="jsftemplating/repo" /> + <argument line="deployment-to-maven-repository t${DSTAMP}${TSTAMP}" /> + </commandline> + </cvs> + </target> </project>