Hi Polly,

good analyzed. From your explanation it is clear an you gave yourself the answer: The workflow file is located only amongst the project's resources. You could add your generator's src/main/resources path as additional resource
        <build>
                <resources>
                        <resource>
                                
<directory>../generator/src/main/resources</directory>
                        </resource>
                </resources>
I think this is just a dirty hack. You should stay with your caller workflow.

~Karsten

Am 07.07.2009 um 03:34 schrieb Polly C. Chang:

Hi Karsten,

Thanks for the explanation. My user project does have a dependency on the generator project, and the "sculptorworkflow.oaw" file is in the root of the classpath in the generator jar because the file resides in src/main/resources.

I debugged into OawWorkflowMojo.getWorkflowDescriptorRoot() for revision 4365, which looks like it's the correct code for the 2.1.1 release. The most interesting part I have pasted here:

    /**
* @return The root where the <code>workflowDescriptor</code> resides
     */
    private File getWorkflowDescriptorRoot(){
        ...

        if (workflowDescriptorRoot == null){
            List<?> resources = project.getBuild().getResources();
            for (int i=0;i<resources.size();i++){
                Resource resource = (Resource) resources.get(i);
                File directory = new File(resource.getDirectory());
                if (directory.exists()){
File workflowScript = new File(directory, workflowDescriptor);
                    if (workflowScript.exists()){
                        workflowDescriptorRoot = directory;
                        break;
                    }
                }
            }
        }
        return workflowDescriptorRoot;
    }


When I get to the line "project.getBuild().getResources()", there are only four entries in the list of resources. These are:

1.  my project's "src\main\resources" directory
2.  my project's root directory
3.  my project's "src\main\java" directory
4.  "oaw-generator"

This line takes each of these directories and tries to see if it can find the workflow file in that directory:
File workflowScript = new File(directory, workflowDescriptor);

Of course this fails because the workflow file is in the generator jar in the classpath and not directly in my project. Is there another way to find the workflow in the generator jar in the classpath?

Thanks,
Polly



On Mon, Jul 6, 2009 at 4:17 PM, Karsten Thoms <karsten.th...@itemis.de> wrote:
Hi Polly,

the project that executes the Fornax plugin needs a dependency to the
project containing sculptorworkflow.oaw. This workflow must be found
on the classpath, you maybe have to add the folder containing the
workflow as additional resource folder when not following the defaults
(e.g. /src/main/resources is on the classpath by default). When
sculptorworkflow.oaw resides not in the classpath root then you have
to qualify the workflow with the package path.

This should be all. The Fornax plugin adds all runtime dependencies of
the project that it is executed within to the context classpath and
then invokes the WorkflowRunner.

Hope this helps you a bit,
~Karsten

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: 
http://p.sf.net/sfu/blackberry_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to