You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Liles <da...@dynamichostings.com> on 2003/06/16 15:06:55 UTC

running project

I just configured Maven and am having trouble understanding the structure and getting my project to run.
 
The documentation states that all projects must have a project.xml file. I've modified an example file but now how do I execute it, what is the call statement I should use?

How do I get Maven to compile my source code? I have tried using the physical path, relative path, everything.... so far I've had no luck. I get a message that states there was no source code found.
 
Also, when I call maven site:deploy I get and error stating that I need to provide a username in order to deploy the project. The username can be placed in the build.property file.... but where does the build.property file need to be located?
 
Finally, do I need to place all of my project source code in the maven folder structure now?
 
Thanks.
 
Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: running project

Posted by Brian Ewins <Br...@btinternet.com>.
Maven (like ant and make) depends on a build descriptor - project.xml - 
that it expects to find in the base directory of your project. e.g. if 
you have a file named:
~/myproject/src/com/foo/Example.java
... then its very likely the directory '~/myproject/' is where you want 
to place your project.xml. If you want to compile the current project 
from anywhere at or below this directory, you can just do:
maven -f project.xml java:compile

the '-f' tells maven to look for the first available 'project.xml' in 
this dir or any of its parents, and use that as the project.xml for the 
build.

The best way to see how this works isn't to start with an existing 
project, but to get maven to generate a project for you. In an empty 
directory, type:
maven -Dpackage=com.example.foo genapp
maven will generate a project.xml for you, and an example directory 
structure, including examples of how to use unit tests with maven. Now type:
maven test:test
This will compile the sample code and its tests, and run the tests.

As for the site:deploy problem: by default maven will try to 'deploy' to 
a secure server using scp, which requires a username and password. This 
is used for deploying to remote live sites. Look at 
<http://maven.apache.org/reference/plugins/site/properties.html>
especially at the "maven.site.deploy.method" property which should help 
you do what you're after. You set this in a properties file called 
project.properties - again in the project root.

You don't need to use the maven folder structure, but it helps. You can 
configure maven to look elsewhere (in a *single* source folder, though), 
see the manual:
<http://maven.apache.org/reference/project-descriptor.html#build>
(sourceDirectory is the thing you're looking for - its in your 
project.xml). You can set up multiple source dirs for code generation 
and the like, but you'd be better coming back and asking about that once 
you have simple projects working.

Hope this helps
	Baz

David Liles wrote:

> I just configured Maven and am having trouble understanding the structure and getting my project to run.
>  
> The documentation states that all projects must have a project.xml file. I've modified an example file but now how do I execute it, what is the call statement I should use?
> 
> How do I get Maven to compile my source code? I have tried using the physical path, relative path, everything.... so far I've had no luck. I get a message that states there was no source code found.
>  
> Also, when I call maven site:deploy I get and error stating that I need to provide a username in order to deploy the project. The username can be placed in the build.property file.... but where does the build.property file need to be located?
>  
> Finally, do I need to place all of my project source code in the maven folder structure now?
>  
> Thanks.
>  
> Dave
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: running project

Posted by Martin Skopp <sk...@riege.de>.
On Mon, 2003-06-16 at 15:06, David Liles wrote:
> I just configured Maven and am having trouble understanding the structure and getting my project to run.

Welcome!

> The documentation states that all projects must have a project.xml file. I've modified an example file but now how do I execute it, what is the call statement I should use?
> How do I get Maven to compile my source code? I have tried using the physical path, relative path, everything.... so far I've had no luck. I get a message that states there was no source code found.

maven java:compile

should do it.  Probably you have a error in your project.xml?  Try

maven pom:validate

to check this.

>  Also, when I call maven site:deploy I get and error stating that I need to provide a username in order to deploy the project. The username can be placed in the build.property file.... but where does the build.property file need to be located?

In your home directory, under unix it's $HOME, under W32 something like
c:\docs+settings\myName\.... 

(AFAIK it's mentioned in the doc as well)

> Finally, do I need to place all of my project source code in the maven folder structure now?

Put your sources underneath the location specified by <sourceDirectory>
in your project.xml.  "src/java" is the default value.

The default maven folder stuc works well for me ;-)
-- 
Martin Skopp
Riege Software International GmbH
Support: mailto:maint@riege.com, Information: http://www.riege.com

This email is intended to be viewed with a nonproportional font.
Public Key on http://www.keyserver.net, Key-ID: 3D4027B5
Fingerprint: 1970 C78D 9A1D 99FA 5CE4  5C0D 29E6 6A95 3D40 27B5


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org