Is there a reason you are constructing the project by hand, rather
than using MavenProjectBuilder which will process inheritence (which
includes the defaults, coming from the "super POM").

- Brett

2008/10/3 Jacob Danner <[EMAIL PROTECTED]>:
> Hi,
> Sorry if this is a dumb question, I queried nabble and checked all the
> docs I could find for an answer in advance.
>
> I'm trying to find out how I can get the default values for a maven
> pom. The POM reference (http://maven.apache.org/pom.html#Directories)
> notes that the default sourceDirectory for a POM is:
>
> ${basedir}/src/main/java
>
> and if the build/sourceDirectory element is not defined in the POM a call to
>
> org.apache.maven.model.Model.getBuild().getSourceDirectory()
> returns null.
> I would like to know if there is a way (other than hard coding a value
> to src/main/java) for me to retrieve the sourceDirectory value.
>
> My code looks similar to:
>
>            String src = ...
>            URL pom = ...
>            MavenXpp3Reader mxr = new MavenXpp3Reader();
>            Model m = null;
>            m = mxr.read(new InputStreamReader(pom.openStream()));
>
>            MavenProject mp = new MavenProject(m);
>
>            if(mp.getBuild().getSourceDirectory() == null)
>                  src = <HOW _TO_GET_DEFAULT_SRC_DIRECTORY>
>
> Any help is appreciated,
> -jacobd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

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

Reply via email to