You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kendall Shaw <ks...@kendallshaw.com> on 2010/03/15 22:00:25 UTC

compile from multiple source directories

Hi,

I have source code in multiple directories that I want to compile. How
can I do that? I can't change the location.

I have read about build-helper-maven-plugin, but I have not managed to
get it to work, e.g.:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>test-build-helper</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>test-build-helper</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>build-helper-maven-plugin</artifactId>
      <version>1.5</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>file:/somewhere/src</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

In src/main there is java that uses the classes that would be compiled
from /somewhere/src.

If I run: mvn package, the compile fails saying it can't find the class
that would have been compiled from /somewhere/src. What do I need to do?

Kendall

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


Release plugin with sourceforge

Posted by Michael Remijan <mj...@yahoo.com>.
Has anyone gotten the Maven release plugin to work on Windows with a CVS SourceForge project.  I've been working on this all day and have made some progress but now I'm stuck.  In my POM, I have my SCM defined as:

<scm>
<connection>scm:cvs:ext:${cvs.username}@ferris.cvs.sourceforge.net:/cvsroot/ferris:ferris-assemblies</connection> 
<tag>HEAD</tag>
<url>http://ferris.cvs.sourceforge.net/viewvc/ferris/ferris-assemblies</url>
</scm>

I've used puttygen.exe to create a key and I have SSH_RSH set to use plink.exe.  

Running cvs commands from the command line works fine.

I then start the release project with:
C:\>mvn -Dmaven.scm.provider.cvs.implementation=cvs_native release:prepare
This actually works OK until it gets to the point where the plugin wants to checkin the new POM.  When it gets to this point it failes with the following error message:
[INFO] Checking in modified POMs...
>[INFO] Executing: cmd.exe /X /C "cvs -z3 -f -q commit -R -F C:\DOCUME~1\MICHAE~1.REM\LOCALS~1\Temp\scm-commit-
>message7879987862192973151.txt pom.xml"
>[INFO] Working directory: C:\Apps\Workspace\ferris-assemblies
>[INFO] ------------------------------------------------------------------------
>[ERROR] BUILD FAILURE
>[INFO] ------------------------------------------------------------------------
>[INFO] Unable to commit files
>Provider message:
>The cvs command failed.
>Command output:
>cvs [commit aborted]: the :extssh: access method is not available on this system
I can't figure out why it's trying to use extssh now??  Anyone have any ideas??

Thanks!
Mike

Re: compile from multiple source directories

Posted by Kendall Shaw <ks...@kendallshaw.com>.
Dan Tran <da...@gmail.com> writes:

>  <configuration>
>              <sources>
>                <source>${basedir}/../../relative to your project
> directory</source>
>              </sources>
>            </configuration>

Well, that's better than nothing. I'm not thrilled about effectively
hard coding the location of the project this way.

> is there a reason why you want to do this way?  can you just do multi
> modules build?

Not without facing the same requirement. There is a giant non-modular
source tree that I have no control over. I need to use some of the
source from that tree.

Kendall

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


Re: compile from multiple source directories

Posted by Dan Tran <da...@gmail.com>.
 <configuration>
             <sources>
               <source>${basedir}/../../relative to your project
directory</source>
             </sources>
           </configuration>

is there a reason why you want to do this way?  can you just do multi
modules build?

-D

On Mon, Mar 15, 2010 at 6:00 PM, Kendall Shaw <ks...@kendallshaw.com> wrote:
> Kendall Shaw <ks...@kendallshaw.com> writes:
>
>> Hi,
>>
>> I have source code in multiple directories that I want to compile. How
>> can I do that? I can't change the location.
>>
>> I have read about build-helper-maven-plugin, but I have not managed to
>> get it to work, e.g.:
>
>
> [snip]
>
> It appears to work if I use antrun plugin to copy the sources below the
> project directory,
> e.g. ${project.build.directory}/generated-sources/main/java. And, then
> add that directory using build-helper plugin.
>
> Is there a way around that? I'd rather not be copying source files.
>
> Kendall
>
> ---------------------------------------------------------------------
> 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: compile from multiple source directories

Posted by Kendall Shaw <ks...@kendallshaw.com>.
Kendall Shaw <ks...@kendallshaw.com> writes:

> Hi,
>
> I have source code in multiple directories that I want to compile. How
> can I do that? I can't change the location.
>
> I have read about build-helper-maven-plugin, but I have not managed to
> get it to work, e.g.:


[snip]

It appears to work if I use antrun plugin to copy the sources below the
project directory,
e.g. ${project.build.directory}/generated-sources/main/java. And, then
add that directory using build-helper plugin.

Is there a way around that? I'd rather not be copying source files.

Kendall

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