Building the Weld JSF examples
asookazian Apr 19, 2010 9:01 PMI recall having problems in the recent past and posting about it here about building the JSF examples in the Weld distro using maven (or possibly ant?). The problem now with login app, for example, was that the 2.0.2-FCS JSF jar was not in the mvn repo and thus the dependency was not resolving. So I had to manually add it to the local repo using mvn deploy:deploy-file as mvn so kindly instructs. Well that takes a while. The command looks like this:
C:\java\weld-1.0.1-Final\examples\jsf\login>mvn deploy:deploy-file -DgroupId=javax.faces -DartifactId=jsf-impl -Dversion=2.0.2-FCS -Dpackaging=jar -Dfile=C:\java\jboss-6.0.0.20100216-M2\server\default\deploy\jbossweb.sar\jsf-libs\jsf-impl.jar -Durl="file://C:\Documents and Settings\asookazian\.m2\repository"
and do it for both the jsf-api.jar and the jsf-impl.jar. The build fails.
Then I just read the release notes for 1.0.1-final and lo and behold the easy way:
* If using Maven, some artifacts are only available in the JBoss Repository. To allow Weld to correctly function, add the JBoss Repository to Maven. Edit your ~/.m2/settings.xml, and add: <profile> <id>jboss.repository</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>repository.jboss.org</id> <url>http://repository.jboss.org/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> </profile>
So I did that, saved changes, opened a new cmd prompt in Windows XP and then try to build the numberguess example:
C:\java\weld-1.0.1-Final\examples\jsf\numberguess>mvn clean install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Weld Examples: Numberguess [INFO] task-segment: [clean, install] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting file set: C:\java\weld-1.0.1-Final\examples\jsf\numberguess\targ et (included: [**], excluded: []) [INFO] Deleting file set: C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\ main\webapp (included: [WEB-INF/classes/**, WEB-INF/lib/**, META-INF/context.xml , WEB-INF/web.xml, WEB-INF/jetty-env.xml, WEB-INF/appengine-web.xml, WEB-INF/log ging.properties], excluded: []) [INFO] [junction:unlink {execution: unlink}] [INFO] [enforcer:enforce {execution: enforce}] [INFO] [build-helper:maven-version {execution: default}] [INFO] [build-helper:parse-version {execution: default}] [INFO] [buildnumber:create {execution: set-build-properties}] [INFO] Checking for local modifications: skipped. [INFO] Updating project files from SCM: skipped. [INFO] Executing: cmd.exe /X /C "svn --non-interactive info" [INFO] Working directory: C:\java\weld-1.0.1-Final\examples\jsf\numberguess Provider message: The svn command failed. Command output: svn: '.' is not a working copy [WARNING] Cannot get the revision information from the scm repository, proceedin g with revision of unavailable : Error! [INFO] Storing buildNumber: unavailable at timestamp: April 19, 2010 11:39:33 AM PDT [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\java\weld-1.0.1-Final\examples\jsf \numberguess\src\main\resources [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 4 source files to C:\java\weld-1.0.1-Final\examples\jsf\numberg uess\target\classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[8,31] package javax.faces.application does not ex ist C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[9,29] package javax.faces.component does not exis t C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[10,29] package javax.faces.component does not exi st C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[11,27] package javax.faces.context does not exist C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[98,35] cannot find symbol symbol : class FacesContext location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[98,58] cannot find symbol symbol : class UIComponent location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[83,64] cannot find symbol symbol : class FacesMessage location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[83,9] cannot find symbol symbol : variable FacesContext location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[102,9] cannot find symbol symbol : class FacesMessage location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[102,36] cannot find symbol symbol : class FacesMessage location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[104,11] cannot find symbol symbol : class UIInput location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[111,11] cannot find symbol symbol : class UIInput location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[113,9] cannot find symbol symbol : class FacesMessage location: class org.jboss.weld.examples.numberguess.Game C:\java\weld-1.0.1-Final\examples\jsf\numberguess\src\main\java\org\jboss\weld\e xamples\numberguess\Game.java:[113,36] cannot find symbol symbol : class FacesMessage location: class org.jboss.weld.examples.numberguess.Game [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Mon Apr 19 11:39:34 PDT 2010 [INFO] Final Memory: 21M/39M [INFO] ------------------------------------------------------------------------
Anybody else seeing this??? Looks like JSF JARs not in classpath. Is that b/c I did not set my JBOSS_HOME? Note the SCM repo warning...
I noticed the instructions for build in the ref doc mostly discuss using ant, not maven...
Getting the same results (compilation failures) when I run 'ant'. So what is wrong??