I am new to web prog. and wicket, so i went to below site to run example source codes to play with applications.
http://www.wicket-library.com/wicket-examples/index.html
Simply i create a "dynamic web project" and try to copy source codes to project.
All example's application classes are that type,
public class ...(ex.name).Application extends WicketExampleApplication
On the internet i found some of those examples with classes WebApplication, and i managed to run those examples, like that
public class ...(ex.name).Application extends WebApplication
So my question are;
1-How can i simply run those examples using dynamic web projects?
2-Copying source codes to my project after that how can i call libraries in my project using maven?
I searched many questions but couldnt find any topic who is trying to run those examples simply in a project.
Thanks.
Soso
instead of doing all the messy work just run mvn using tthis
[http://wicket.apache.org/start/quickstart.html]
now just copy the sources
if you any problem and you want to add wicket to an existing project just copy the web..xml , wicket jars and you would have wicket project (i would recomend wicket from another opm connecting you existing services and this way decouple services from the web container ...)
P. S the WebApplication thing they just inehrited it and called ExampleWebApplication
The best you can do is to use maven integration
Install Eclipse (that support Java EE)
Add all required maven related plugins
Version Control: Use Subclipse 1.8.x, see: http://subclipse.tigris.org/update_1.8.x
Maven Integration: m2e , is included in Eclipse Classic. Use
Help->Install New Software, select "--All available sites--" and
choose Collaboration -> m2e - Maven Integration for Eclipse
Subclipse/Maven Integration: Update site: http://subclipse.tigris.org/m2eclipse/1.0/
Then, just checkout the maven examples you got on the web
Go Eclipse--Window-->Show view-->Other
Type svn and select SVN repositories and open it
Then copy the check out address and add it to the svn repositories View
finaly, right click on the link you have added and check out as maven projects.
If you want to create new Maven projects
Create new maven Projects, new-->project-->Maven project
then in new Maven Project Window, in the Filer Text box, Type wicket and select org.apche.wicket as a groupID
After that, you can have your maven codes working well.
If still you got some debug errors, you can open your pom.xml file and add dependencies such as wicket-core and wicket-extensions
Related
I am sorry i don't know maven good enough for the complex environment i am currently working in (1k+ applications, most of them are Java EE). I still give it a try to describe what i want to archive:
0.) There is a company framework that abstracts the Java EE World a bit and is used in all the Java EE components
1.) I checked out the maven project of the Java EE component i am working with
during the build it downloads the dependencys of other components out of the companys repository and stores it inside my local repo for compilation. So i can see the jar-files of the companys framework inside my local repo.
2.) I now want to change some of the frameworks functionality for a local test so i checked out their sources from another SVN repository. I made the changes and build that framework component with maven "clean install".
3.) I rebuild the component i am working with as well.
Inside eclipse i can now click on one of a frameworks classes method and it opens the according source. But this only happens because the local repo is meant to contain source-jars for any dependency as well. So in my editor i can see this source is from the jar of the framework in my local repo and i cant change anything.
Could someone please give me a hint how i can archive the following:
I can make changes to the framework (and build the frameworks jars with "clean install")
I can build my component and it uses the above compiled framework jars rather than the "old" ones from the local repo.
I will right now start to read the entire maven documentation and each and every section (i try to understand that dependency management since 1 year and still don't get it) but i would really appreciate if you could help me out a bit here.
I don't know how Eclipse manages maven dependencies, but
In IntelliJ IDEA this is simple - if maven dependency is in project then IDEA uses it instead of dependency from local repo.
So if u want to edit framework source code and use this changes immidiately - i think that framework should be in your Eclipse Workspace. And your module in Eclipse should reference framework artifacts directly - not over Maven dependency mechanism.
I think that this is a Eclipse Maven plugin responsibility. Do u have any installed Maven plugin for Eclipse? (M2Eclipse for example)
Hello Guys,
I am new to both maven and spring. I want to create a maven based spring project and Here is what I am doing.
New->other -> maven project -> next -> next -> ?
Here I want to select a type of project with required folder set up. For example to set up a simple maven based java project i select maven-archetype-quickstart . But coming to spring I dont know which artifact to select and I have the feeling that it is not showing all the artifacts. I am attaching some screenshots of that step where I got confused.
To be more brief:
1) If I want to get a spring project which artifact should I select
2) It looks like I am not able to see all artifacts here. For example when I look for spring I see only two artifacts. when I search for webapp i see only two artifacts. Should I do any configurations?
3)How to know which artifact suites for example for basic spring project which artifact should I choose?
My questions might be pretty basic. Please help me
Thanks
The appfuse-basic-spring archetype should create a single directory spring project. This is probably what you want for a simple project.
The appfuse-modular-spring should create a multi-module (read: parent module with several child modules) project. For more information on multi-module maven projects I would suggest looking at chapters 6 and 7 of Maven by Example.
I need to build java project. The project should include two modules: domain and web.
The domain module contains all the entities, the business logic and hibernate integration.
The web module should be depend on the domain module and contains web application using apache wicket.
I wonder about the maven usage.
Should I create a project and modules using maven? If so, how?
What kind of archetype are relevant for my project and modules?
What is better experience - create the project myself or use maven?
I am using intellij.
I'm assuming you don't need a server for others to access your code,
but rather, you want to use maven/ant for internal project
organization/dependency resolution/source organization.
Should I create a project and modules using maven?
Yes, either maven or ant will be useful for any non-trivial Java or Java EE project with external dependencies, and build/testing requirements.
If so, how?
Either ant/maven will allow you to easily setup a platform independent "build" file, so that you can easily resolve dependencies, build your jar executables, and run unit tests in order by issuing a single command, rather than multiple clicks to different plugins in whatver the ide-of-the-month is. You can do this in eclipse using the maven plugin to create a new maven project, or , as you suggest, by creating an artifact by running the regular mvn install.
What kind of archetype are relevant for my project and modules?
To learn use maven-archetype-quickstart.
For a regular (simple) j2ee app, try maven-archetype-webapp.
There is also a j2ee archetype as well.
What is better experience - create the project myself or use maven?
A simple, 3-step, robust method for setting up a maven project :
1) Use maven archetypes to create and setup your "hello world" project.
2) Import the maven project into your ide as a java project.
3) Edit/refine/fix code in your IDE, but use maven to build and test the whole application.
Update: external web frameworks
Creating a wicket (or gwt or any other framework) oriented web app will
Be best done following specific tutorials related to the framework itself. In order to add theframework libs, just paste the maven info in your pom.xml like thus, and run a "mvn install" command :
<dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
<version>1.5.3</version>
</dependency>
I'd recommend you to use maven. The reasons why I use maven:
IDE agnostic. You can use idea, eclipse or some other ID.
Dependencies management
Powerful plugin system
You can manually create 3 maven module
app.parent with pom packaging and no parent.
app.domain with jar packaging and app.parent parent
app.web with war packaging and app.parent parent
and import app.parent to idea.
Also checkout Wicket quick-start Maven archetype creation page http://wicket.apache.org/start/quickstart.html
I'm having some issues making the maven google app engine plugin work properly.
First of all, I'm not even sure if the archetype I'm using is the correct one, their examples show version 0.7.0 but it seems like never versions exist (i tried 0.9.1 and that works), where can I find a overview of what versions of the plugin is available?
Secondly, the archetype seems.. messy, I don't like the package structure and it doesn't seem to actually include the GAE and GWT dependencies. I have to manually add them to my project in Eclipse, which kind of defeats the purpose of using maven. And how come they are breaking the gwt maven plugin? I know that one includes the actual gwt jars as maven dependencies?
I'm fairly new to Maven, but I have been using the gwt maven plugin for a while, and I'm very happy with everything about it. Is there any way I could just their archetype to do the base project and add the gae plugin to it?
UPDATE
I suspect the problem I'm seeing with the GAE maven plug-in is in regards to undefined properties in the POM. I have no idea if its due to error these aren't set-up or if its due to me actually have to manually set them up. The documentation on this plugin is sparse.
Thanks for the answer below, but I really don't want to add another archetype into play. I think the best solution for me is to try and adapt a GWT maven project manually, to include support for GAE.
I've used the archetype like so :
http://code.google.com/p/gae-mvn-archetype/
to generate a GAE project template.Then manually added my other dependencies. This got me a usable project which I can deploy to GAE and everything.
Also, for Eclipse importing, once the template project was done, I've imported it into eclipse using the m2_eclipse plugin :
http://m2eclipse.sonatype.org/installing-m2eclipse.html
(note that i've imported it into Eclipse as a Maven project, NOT as an Eclipse whatever project)
This imported the thing into eclipse with all the necessary dependencies and without errors.
I'm looking for an example Spring MVC 2.5 web app that I can easily:
Setup as a project in Eclipse
Deploy to a local app server (using Ant/Maven)
There are a couple of example applications included with the Spring distribution ('petclinic' and 'jpetstore'), but they don't provide any Eclipse project files (or a way to generate them). They also seem a bit complicated for my needs, e.g. require a local database to be setup.
The easiest way to get up and running with a Spring MVC project is to use SpringSource Tool Suite, which is another free IDE based on Eclipse.
The integration between the IDE and Spring/Maven is tight, and it comes with an application server already setup for you to deploy your web app.
Follow these steps to get a working Spring MVC web app.
To setup a new project in STS: Click File -> New -> Spring Template Project -> Spring MVC Project
To pull in dependencies and compile your project: Right click your new project -> Run As -> Maven install
To run your project inside an application server: Right click your new project -> Run As -> Run on Server -> SpringSource tc Server
If it works, you'll see a web page saying "Congratulations! You're running Spring!"
While not specifically an app you can download, Developing a Spring Framework MVC application step-by-step covers creating a spring application in Eclipse with an ant build script, complete with unit tests.
This meets the following requirements:
Spring MVC 2.5
Project in Eclipse
Deploy to a local app server using Ant
Uses HSQL (no need to install a local DB)
There's a Maven archetype (template project structure) for Spring MVC here:
http://docs.codehaus.org/display/MAVENUSER/Archetypes+List
That's a good starting place for this kind of investigation. To create an archetype using Maven, first install Maven:
http://maven.apache.org/plugins/maven-install-plugin/
and then create a project using the archetype:
http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
You can also use the m2eclipse plugin for Eclipse to simplify this and it takes you through the stages of the project using a wizard. Just right click -> New Project -> Other, Maven and select the archetype. Hope that helps.
Just spotted http://blog.springsource.com/2010/07/22/spring-mvc-3-showcase/ which could be interessting for you.
To generate Eclipse project files:
Use mvn eclipse:eclipse before importing the project into your workspace. This will create all required configuration files and hook your project up with all the required dependencies.
The mvc-basic and mvc-ajax sample projects in spring-samples (SVN URL: https://src.springframework.org/svn/spring-samples) are simple projects that do not need any local database support.
Use AppFuse
I got it working just as Drew described, but there is a trap for new users (meaning fresh install, no familiarity with Maven or m2eclipse). You'll get this error:
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: /home/user/.m2/settings.xml
And the work around is to just make an almost empty settings.xml:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
</settings>
(I later found this bug report.)
After that, I was in business. I was even able to export as a WAR file and deploy onto my installation of WebSphere Community Edition. Thank you, Drew!
A little less earlier, I wrote:
Hmph. Never mind. I gave up, shut down my machine, and when I came back, everything worked (except for a minor Maven issue I'm working on). Chalk it up to a bug.
Earlier, I wrote:
I was very excited to hear about STS, so I downloaded and installed it. It went perfectly. This is a new machine, so I have the latest of everything - java 1.6, eclipse 3.5.1, etc.
On step 2 of the above instructions, I get this error:
"The specified JRE installation does not exist"
I've set paths everywhere I can find, so I'm not sure which JRE it's complaining about. Help?
You could also use Spring Roo to do this. http://www.springsource.org/roo
You can use below link to download hello world spring mvc project
Spring MVC hello world example