Help: JSF Development and Build with Eclipse

Hello, I could use some help from java gurus, on building java web project. Here's my scenario: We use Eclipse, and Tomcat; during development, as usual we add libraries on the java build path (JDBC, Shiro authentication support, JSF and JSTL etc), we however discovered that we still have to add (some of) the libraries on Tomcat as well. (isn't there a better way of doing this?) The main question though for the build; the ideal option I understand is to convert eclipse project to Maven. I'm wondering if there's anything we need to do with dependencies on pom.xml, or eclipse will do it automatically. I did with a test project and realized there's nothing on the dependacies on pom.xml. Will appreciate some advise. -- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka

Dear Samuel, Ideally when you build your war(web archive) file, the dependencies i.e the jar files are placed in the lib folder. When the war is deployed in tomcat, it is self extracting and the application will reference those libraries. Therefore everything depends on how you build your application. The build tools you can use include Ant, Maven, Gradle <https://gradle.org/>just to mention a few. I use maven, currently. You would have to add your dependencies inside the <dependencies> tag something like *...* <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate.version}</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>${commons.beanutils.version}</version> </dependency> *...* </dependencies> These dependencies are place in a folder .m2. If you are using windows7 or linux the m2 folder is located in the user home folder i.e c:\users\username(windows7/8/10) or ~/.m2(linux) If these dependencies are missing in the m2 folder you will get a message when building your application to inform you of this as below [INFO] Failed to resolve artifact. Missing: ---------- 1) com.ibm.mq:commonservices:jar:7.0.1_11 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.ibm.mq -DartifactId=commonservices -Dversion=7.0.1_11 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.ibm.mq -DartifactId=commonservices -Dversion=7.0.1_11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) com.zeno.ebills:paybill:war:1.0 2) com.ibm.mq:commonservices:jar:7.0.1_11 You simply need to follow the instructions given by running the command shown as follows mvn install:install-file -DgroupId=com.ibm.mq -DartifactId= commonservices -Dversion=7.1 -Dpackaging=jar -Dfile=/home/administrator/workspace/paybills/libs/mq/com.ibm.mq. commonservices.jar I hope this is helpful. On Wed, Nov 16, 2016 at 9:18 AM, Samuel Waithaka via skunkworks < skunkworks@lists.my.co.ke> wrote:
Hello,
I could use some help from java gurus, on building java web project. Here's my scenario: We use Eclipse, and Tomcat; during development, as usual we add libraries on the java build path (JDBC, Shiro authentication support, JSF and JSTL etc), we however discovered that we still have to add (some of) the libraries on Tomcat as well. (isn't there a better way of doing this?)
The main question though for the build; the ideal option I understand is to convert eclipse project to Maven. I'm wondering if there's anything we need to do with dependencies on pom.xml, or eclipse will do it automatically. I did with a test project and realized there's nothing on the dependacies on pom.xml.
Will appreciate some advise.
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Thanks Jude,
From what you say, it seems we'll have to add the libraries in the dependencies list manually; I can work with Maven too, soI have to convert it first, which is possible with Eclipse - with the necessary plugin (m2e-connector). Thanks again. Let me try that and see how it goes.
On Wed, Nov 16, 2016 at 10:15 AM, Jude Kikuyu <jkikuyu@gmail.com> wrote:
Dear Samuel,
Ideally when you build your war(web archive) file, the dependencies i.e the jar files are placed in the lib folder. When the war is deployed in tomcat, it is self extracting and the application will reference those libraries.
Therefore everything depends on how you build your application. The build tools you can use include Ant, Maven, Gradle <https://gradle.org/>just to mention a few.
I use maven, currently. You would have to add your dependencies inside the <dependencies> tag something like
*...*
<dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate.version}</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>${commons.beanutils.version}</version> </dependency>
*...* </dependencies> These dependencies are place in a folder .m2. If you are using windows7 or linux the m2 folder is located in the user home folder i.e c:\users\username(windows7/8/10) or ~/.m2(linux) If these dependencies are missing in the m2 folder you will get a message when building your application to inform you of this as below [INFO] Failed to resolve artifact.
Missing: ---------- 1) com.ibm.mq:commonservices:jar:7.0.1_11
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=com.ibm.mq -DartifactId=commonservices -Dversion=7.0.1_11 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.ibm.mq -DartifactId=commonservices -Dversion=7.0.1_11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency: 1) com.zeno.ebills:paybill:war:1.0 2) com.ibm.mq:commonservices:jar:7.0.1_11
You simply need to follow the instructions given by running the command shown as follows
mvn install:install-file -DgroupId=com.ibm.mq -DartifactId= commonservices -Dversion=7.1 -Dpackaging=jar -Dfile=/home/administrator/ workspace/paybills/libs/mq/com.ibm.mq.commonservices.jar
I hope this is helpful.
On Wed, Nov 16, 2016 at 9:18 AM, Samuel Waithaka via skunkworks < skunkworks@lists.my.co.ke> wrote:
Hello,
I could use some help from java gurus, on building java web project. Here's my scenario: We use Eclipse, and Tomcat; during development, as usual we add libraries on the java build path (JDBC, Shiro authentication support, JSF and JSTL etc), we however discovered that we still have to add (some of) the libraries on Tomcat as well. (isn't there a better way of doing this?)
The main question though for the build; the ideal option I understand is to convert eclipse project to Maven. I'm wondering if there's anything we need to do with dependencies on pom.xml, or eclipse will do it automatically. I did with a test project and realized there's nothing on the dependacies on pom.xml.
Will appreciate some advise.
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka

Hello, You can try the eclipse tomcat plugin in, to deploy from eclipse when you are on dev mode https://www.mulesoft.com/tcat/tomcat-eclipse You can also use maven, ant or gradle to create and deploy a war file rather than a jar file. The war file will contain your classes and jars. https://www.mkyong.com/maven/how-to-create-a-web-application-project-with-ma... https://www.petrikainulainen.net/programming/gradle/getting-started-with-gra... Regards, Keyman On Wed, Nov 16, 2016 at 9:18 AM, Samuel Waithaka via skunkworks < skunkworks@lists.my.co.ke> wrote:
Hello,
I could use some help from java gurus, on building java web project. Here's my scenario: We use Eclipse, and Tomcat; during development, as usual we add libraries on the java build path (JDBC, Shiro authentication support, JSF and JSTL etc), we however discovered that we still have to add (some of) the libraries on Tomcat as well. (isn't there a better way of doing this?)
The main question though for the build; the ideal option I understand is to convert eclipse project to Maven. I'm wondering if there's anything we need to do with dependencies on pom.xml, or eclipse will do it automatically. I did with a test project and realized there's nothing on the dependacies on pom.xml.
Will appreciate some advise.
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Thanks Keyman, taking a look. On Wed, Nov 16, 2016 at 10:29 AM, Keyman Ephraims <keymanclassic@gmail.com> wrote:
Hello,
You can try the eclipse tomcat plugin in, to deploy from eclipse when you are on dev mode https://www.mulesoft.com/tcat/tomcat-eclipse
You can also use maven, ant or gradle to create and deploy a war file rather than a jar file. The war file will contain your classes and jars. https://www.mkyong.com/maven/how-to-create-a-web-application-project-with- maven/ https://www.petrikainulainen.net/programming/gradle/ getting-started-with-gradle-creating-a-web-application-project/
Regards,
Keyman
On Wed, Nov 16, 2016 at 9:18 AM, Samuel Waithaka via skunkworks < skunkworks@lists.my.co.ke> wrote:
Hello,
I could use some help from java gurus, on building java web project. Here's my scenario: We use Eclipse, and Tomcat; during development, as usual we add libraries on the java build path (JDBC, Shiro authentication support, JSF and JSTL etc), we however discovered that we still have to add (some of) the libraries on Tomcat as well. (isn't there a better way of doing this?)
The main question though for the build; the ideal option I understand is to convert eclipse project to Maven. I'm wondering if there's anything we need to do with dependencies on pom.xml, or eclipse will do it automatically. I did with a test project and realized there's nothing on the dependacies on pom.xml.
Will appreciate some advise.
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka
_______________________________________________ skunkworks mailing list skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Samuel Waithaka Cell: +254 720 317929 | +254 770 451280 http://twitter.com/samwaithaka
participants (3)
-
Jude Kikuyu
-
Keyman Ephraims
-
Samuel Waithaka