AnsweredAssumed Answered

Use external code in the Module AMP

Question asked by dranakan on Oct 6, 2010
Latest reply on Oct 7, 2010 by dranakan
Hello,

I would like to use code inside another projet. I have some problems to generate my module.

The Eclipse projets
Projet_common (contains Tools.java)
Module_Alfresco_Custom

build.xml (working)


<target name="compile">
  <mkdir dir="${build.dir}/classes" />
  <javac classpathref="class.path" srcdir="${project.dir}/source/java" destdir="${build.dir}/classes">
  </javac>
</target>

build.xml (take code inside the Projet_common, not working)

<property name="src_Common" location="../Projet_common/src" />
<target name="compile">
  <mkdir dir="${build.dir}/classes" />
  <javac classpathref="class.path" srcdir="${src_Common}:${project.dir}/source/java" destdir="${build.dir}/classes">
  </javac>
</target>

Error message

Apache Ant version 1.7.1 compiled on June 27 2008

compile:
    [mkdir] Skipping G:\custom\doc_temp\03_Projet_GED\06_Code\Java\Module_Alfresco_Custom\build\classes because it already exists.
    [javac] ch\custom\common\workers\Tools.java added as ch\custom\common\workers\Tools.class doesn't exist.

BUILD FAILED
G:\custom\doc_temp\03_Projet_GED\06_Code\Java\Module_Alfresco_Custom\build.xml:28: G:\custom\doc_temp\03_Projet_GED\06_Code\lib\server not found.
   at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:434)
   at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
   at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:110)
   at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:90)
   at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:250)
   at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.iterator(BaseResourceCollectionContainer.java:126)
   at org.apache.tools.ant.types.Path.iterator(Path.java:693)
   at org.apache.tools.ant.types.Path.iterator(Path.java:687)
   at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:110)
   at org.apache.tools.ant.types.resources.Union.list(Union.java:69)
   at org.apache.tools.ant.types.Path.list(Path.java:359)
   at org.apache.tools.ant.types.Path.addExisting(Path.java:330)
   at org.apache.tools.ant.types.Path.addExisting(Path.java:318)
   at org.apache.tools.ant.types.Path.concatSpecialPath(Path.java:563)
   at org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:515)
   at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.getCompileClasspath(DefaultCompilerAdapter.java:153)
   at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.setupJavacCommandlineSwitches(DefaultCompilerAdapter.java:183)
   at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.setupModernJavacCommandlineSwitches(DefaultCompilerAdapter.java:321)
   at org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.setupModernJavacCommand(DefaultCompilerAdapter.java:368)
   at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:48)
   at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
   at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:357)
   at org.apache.tools.ant.Target.performTasks(Target.java:385)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
   at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
   at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)

Total time: 1 second

Thanks

Outcomes