See Stephen's comment from a previous email. You're getting *way* ahead of yourself. You've got some very basic problems that are going to get in your way long before dependencies are an issue. Either get yourself a copy of "Maven: The Definitive Guide" or use the online copy -> http://www.sonatype.com/community/definitive_guide.html. And, as Stephen pointed out, go slow! It will help you learn if you don't try to do too much all at one time.

Good luck!


Jan K wrote:
Hi dchicks,

I will explain in detail what i have in my hand.

I created a project in maven.I have a folder structure created .Please
note,i have client related java files in one folder,Servlet related java
files in another folder and so on in my project.So In src/main/java ,i
copied all the jave files(with the folder structure such as client ,servlet
etc) i have in my project and placed it there.Now in src/main/java,i have
nearly 6 folders having java files.I have run it using ant.Now i asked to do
the same in Maven.In ant,i have dependency written for each a every thing
required in a xml file and finally will call all the xml files in build.xml.
How should i do this using maven?Also i read in a article as : maven will
download the the dependency required for our project.How can i add my own
dependencies in maven?please help.


dchicks wrote:
Jan,

I would first suggest you search the main repository to make sure that the dependency you're looking for is truly not already in there. Here is the site to search: http://www.mvnrepository.com/

If you can't find what you're looking for there, then you can always add dependencies to your local repository using the "install" command. It goes something like this:

mvn install:install-file -DgroupId=<grouIp> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -Dfile=</path/to/file>

If you need to share that dependency among a team of developers, then I would suggest looking at Artifactory to set up your own site-wide repository. It will also cache dependencies pulled from the main repository and save you a little bit of network bandwidth: http://www.jfrog.org/sites/artifactory/1.2/

Dave

Jan K wrote:
I went through the book,i donot find any information regarding adding our
own
dependencies in maven.
I read a article as :
<dependency>
   <groupId>quartz</groupId>
   <artifactId>quartz</artifactId>
   <version>1.5.1</version>
   <scope>compile</scope>
 </dependency>

Maven downloads and use Quartz as a dependency for our project.So
whatever
dependency we need,maven will download right?but i have some predefined
dependency for my project which doesnot exist in maven.Please let me know
how should i load my own dependency into maven and call it using
<dependency> tag.


Jan K wrote:
Is there any possiblity of adding our own dependencies in maven?



Thomas Lutz wrote:
Jan K schrieb:
First time i created a project using
 mvn archetype:create -DgroupId=com.careertales
-DartifactId=careertales
-DarchetypeArtifactId=maven-archetype-webapp.

I got a folder structure as :
src/main
 -- resources
 -- webapp

In resources folder,i placed a simple java file(Test.java) which just
prints
a string.In webapp folder,I got some default index.jsp file and  a
web-inf
folder.Then i executed mvn install command.I got Build Successful in
my
console.I am able to see a target folder created.Inside this target
folder i
have war,classes,careertales.war folders.Then i executed mvn compile
command.Inside classes folder, my point is i should see the  class
file
of
Test.But instead i can see the same Test.java file in classes
folder.What is
going wrong?
resources is not compiled.. it's for "resources". place it in src/main/java...

follow the maven in 5 minutes guide from http://maven.apache.org ... start with the standard java archetype... makes it easier :-)

After that i placed a java file(This file prints a string)


matinh wrote:
On Thursday 16 October 2008 Jan K wrote:
I went through the site given by arnaud.It is really useful for as i
am
new maven.
Through the whole book? Really?

It get the following message in the console:

[INFO] OldArchetype created in dir:
/home/jano/CVS/margadarsi/ct3/src/careertales
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 17 seconds
[INFO] Finished at: Thu Oct 16 13:44:21 GMT+05:30 2008
[INFO] Final Memory: 7M/13M
The build succeeds. The question is, what did you build? Accoring to
the messages above I guess you executed some "mvn archetype:create" command, right? This does not compile anything, it generates a new project.

I have placed my java files in src/main/java.I dont get the class
files
generated when i compile.What is wrong in my code?please help
How do you compile? As I explained earlier you should execute "mvn
compile" to compile your classes. The result can be found in the folder target/classes.

hth,
- martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to