cancel
Showing results for 
Search instead for 
Did you mean: 

Steps to deploy a successfully imported project in Eclipse?

jamen
Confirmed Champ
Confirmed Champ
Hi,

I have successfully imported the projects from the Alfresco Source package into Eclipse, following the steps in the Wiki.  I was wondering whether anyone has any information on how to configure Eclipse and the projects to allow me to deploy the application using a Tomcat plugin such as Sysdeos.

I have considered importing the build.xml file in, but I can't because all the javac statements are in the project-build.xml files.  At this stage I can only get everything packaged into war files using ant at the command line in the appropriate directory.  Any help anyone on this subject would be appreciated.
7 REPLIES 7

turgayz
Champ in-the-making
Champ in-the-making
I am using the sysdeo Tomcat plugin, and here is what I do:
- Run the ant task within Eclipse ant view (I am running the incremental-tomcat task)
- Start Tomcat from the sysdeo plugin icon located on the Eclipse toolbar.

I have considered importing the build.xml file in, but I can't because all the javac statements are in the project-build.xml files.
I could not understand the problem about the build.xml file. Why do you need to import it? Because it is already in the project "common". You may need to check out the projects from the SVN server as "Java projects", this may solve your problem.

HTH,

jamen
Confirmed Champ
Confirmed Champ
Just to double check that I have included everything I should have…

I stored my Alfresco source code in a directory c:\AlfresoSource.  I originally was going to put it into my workspace directory, however this caused a conflict of some sort when I was trying to import.

I imported all the projects in the order described by the wiki entry on setting up my eclipse dev environment.  One or two of the projects wouldn't import though, such as installation (which is expected from further reading I have done).

Now from what you said, I gather I should be importing in some way the build.xml file which lies in C:\AlfrescoSource\common.  The problem is I can't seem to import this directory/file into Eclipse (as an  as it says that the build.xml has no javac declaration in it.  All the javac statements are in the individual project-build.xml files. 

How do I import the build.xml file into Eclipse given this problem?  'incremental-tomcat' is contained in this build.xml file from what I can see…

Cheers
Jamen

turgayz
Champ in-the-making
Champ in-the-making
I guess that you checked out the projects using the command line svn client. I don't know how to setup everything with that as I have not done it.

I had used the Subclipse Eclipse plugin, and checked out the sources to a directory other than my Eclipse workspace, as you have done with c:\AlfresoSource.

You can try the Subclipse plugin to see if that solves your problems (http://subclipse.tigris.org/). Let me know if it does not, and I'll try to write a walkthrough.

dream_zh
Champ in-the-making
Champ in-the-making
import the  parent directory of "projects" and "common" as the root of alfresco
you will succeed!

gavinc
Champ in-the-making
Champ in-the-making
Hi,

I have just added a section to the development environment wiki page to explain how you can reference and run the ant build scripts in your Eclipse environment (this is how I do it anyway).

http://www.alfresco.org/mediawiki/index.php/Development_Environment#Running_Ant_From_Eclipse

cmeinck
Champ in-the-making
Champ in-the-making
When I set up build.xml as detailed above, I get an error when I run Ant from Eclipse:

Buildfile: X:\Alfresco_source_12\common\build.xml

common-init.init:
        [echo] Starting build for alfresco at 13:15

init:

clean:

init:
        [echo] Starting build for core at 13:15

clean:
      [delete] Deleting directory X:\Alfresco_source_12\projects\core\build\classes

init:
        [echo] Starting build for repository at 13:15

clean:

common-init.init:
        [echo] Starting build for remote-api at 13:15

init:

clean:

init:
        [echo] Starting build for jcr at 13:16

clean:

init:
        [echo] Starting build for web-client at 13:16

common.clean:

clean:

common-init.init:
        [echo] Starting build for web-service-client at 13:16

init:

clean:

incremental-tomcat:

init:
        [echo] Starting build for core at 13:16

compile-java:
       [mkdir] Created dir: X:\Alfresco_source_12\projects\core\build\classes
       [javac] Compiling 53 source files to X:\Alfresco_source_12\projects\core\build\classes
       [javac] javac: invalid target release: 1.5
       [javac] Usage: javac <options> <source files>
       [javac] where possible options include:
       [javac]   -g                        Generate all debugging info
       [javac]   -g:none                   Generate no debugging info
       [javac]   -g:{lines,vars,source}    Generate only some debugging info
       [javac]   -nowarn                   Generate no warnings
       [javac]   -verbose                  Output messages about what the compiler is doing
       [javac]   -deprecation              Output source locations where deprecated APIs are used
       [javac]   -classpath <path>         Specify where to find user class files
       [javac]   -sourcepath <path>        Specify where to find input source files
       [javac]   -bootclasspath <path>     Override location of bootstrap class files
       [javac]   -extdirs <dirs>           Override location of installed extensions
       [javac]   -d <directory>            Specify where to place generated class files
       [javac]   -encoding <encoding>      Specify character encoding used by source files
       [javac]   -source <release>         Provide source compatibility with specified release
       [javac]   -target <release>         Generate class files for specific VM version
       [javac]   -help                     Print a synopsis of standard options

BUILD FAILED
X:\Alfresco_source_12\common\build.xml:42: The following error occurred while executing this line:
X:\Alfresco_source_12\common\common.xml:24: Compile failed; see the compiler error output for details.


Total time: 1 minute 22 seconds

I checked the JRE settings for Ant and I get this error whether it's set to "Run in the same JRE as the Workspace" or whether I manually point it to JRE1.5.

I get no problems when I run Ant from the command line.

gavinc
Champ in-the-making
Champ in-the-making
It looks like Eclipse is trying to use a 1.4 JDK rather than a 1.5 JDK.

Have you got Eclipse set to use a compliance level of 5.0?

Check the Ant Runtime preferences, on my installation the "Global Entries" node on the Classpath tab points to "JAVA_HOME\jdk1.5.0_06\lib\tools.jar", make sure yours points to a 1.5 JDK.