You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adam Hardy <ad...@cyberspaceroad.com> on 2005/07/28 17:39:18 UTC

[m2] alpha3 - xdoclet, compile, ear and install

I'm putting together an EJB ear and I need some clarification on a 
couple of points.

(1) I can't get the maven-xdoclet-plugin to install using the docs on 
http://www.neonics.com/projects/maven-xdoclet-plugin/

When I try to install it, I use this cmd:

adam@gondor:~/java/projects/garg-ejb$ m2 install:install-file 
-DartifactId=plexus-override-component-configurator   -DgroupId=plexus 
-Dversion=1.0-SNAPSHOT 
-Dfile=plexus-override-component-configurator-1.0-SNAPSHOT.jar 
-Dpackaging=jar

and get an error saying that the plugin is not found in my project 
directory, which is obviously my cmd line being wrong. What would be the 
correct cmd line to install it?

(2) Even if I could get the xdoclet to run in m2, I can't figure out how 
to include a second source directory (containing the xdoclet generated 
classes). Is it just a comma-delimited list in the <sourceDirectory> 
attribute of the pom?

(3) m2 can't find the maven-ear-plugin. According to the msg here 
http://marc.theaimsgroup.com/?l=turbine-maven-user&m=111962447408741&w=2
it looks like I have to copy it from maven2/org/apache/maven/plugins to 
my local repository and change its directory structure. Is there a 
command line to get m2 to download it, so I then only have to change the 
dir?

At this point if I get an answer to any of these I'd be grateful.


regards
Adam

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


Re: [m2] alpha3 - xdoclet, compile, ear and install

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Kenney Westerhof on 09/08/05 06:51, wrote:
> On Thu, 28 Jul 2005, Adam Hardy wrote:
>>(1) I can't get the maven-xdoclet-plugin to install using the docs on
>>http://www.neonics.com/projects/maven-xdoclet-plugin/
>>
>>When I try to install it, I use this cmd:
>>
>>adam@gondor:~/java/projects/garg-ejb$ m2 install:install-file
>>-DartifactId=plexus-override-component-configurator   -DgroupId=plexus
>>-Dversion=1.0-SNAPSHOT
>>-Dfile=plexus-override-component-configurator-1.0-SNAPSHOT.jar
>>-Dpackaging=jar
>>
>>and get an error saying that the plugin is not found in my project
>>directory, which is obviously my cmd line being wrong. What would be the
>>correct cmd line to install it?
> 
> 
> That's weird. I can partly reproduce:
> 
[snip]
> 
> and that's because the file is not in the current directory. Did you
> download it?

Doh! I didn't realise I had to download the file and run the command 
from the dir where i downloaded it. Sorry. I had moronically assumed it 
would go and get the file from the repo.


>>(2) Even if I could get the xdoclet to run in m2, I can't figure out how
>>to include a second source directory (containing the xdoclet generated
>>classes). Is it just a comma-delimited list in the <sourceDirectory>
>>attribute of the pom?
> 
> Brett answered this. I can add the following:

Yes, I figured that out. Thanks.


> Sorry for the late reply, and thanks for trying it out!

No problem. Thank you for putting it together.


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


Re: [m2] alpha3 - xdoclet, compile, ear and install

Posted by Kenney Westerhof <ke...@apache.org>.
On Thu, 28 Jul 2005, Adam Hardy wrote:

Hi, Just saw Brett answering this. I totally missed this post - sorry.

> I'm putting together an EJB ear and I need some clarification on a
> couple of points.
>
> (1) I can't get the maven-xdoclet-plugin to install using the docs on
> http://www.neonics.com/projects/maven-xdoclet-plugin/
>
> When I try to install it, I use this cmd:
>
> adam@gondor:~/java/projects/garg-ejb$ m2 install:install-file
> -DartifactId=plexus-override-component-configurator   -DgroupId=plexus
> -Dversion=1.0-SNAPSHOT
> -Dfile=plexus-override-component-configurator-1.0-SNAPSHOT.jar
> -Dpackaging=jar
>
> and get an error saying that the plugin is not found in my project
> directory, which is obviously my cmd line being wrong. What would be the
> correct cmd line to install it?

That's weird. I can partly reproduce:

[ERROR] Cause:
org.apache.maven.plugin.MojoExecutionException: Error configuring plugin
for exe
cution of 'install:install-file'.
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:339)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:472)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:453)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:435)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:268)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:127)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:186)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.PluginParameterException: Invalid or
missing
parameters: [Mojo parameter [name: 'file'; alias: 'null']] for mojo:
org.apache.
maven.plugins:maven-install-plugin:2.0-beta-1-SNAPSHOT:install-file
        at
org.apache.maven.plugin.DefaultPluginManager.checkRequiredParameters(
DefaultPluginManager.java:779)
        at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(Defaul
tPluginManager.java:518)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:334)
        ... 15 more


and that's because the file is not in the current directory. Did you
download it?


> (2) Even if I could get the xdoclet to run in m2, I can't figure out how
> to include a second source directory (containing the xdoclet generated
> classes). Is it just a comma-delimited list in the <sourceDirectory>
> attribute of the pom?

Brett answered this. I can add the following:

In the alpha-3 version, you cannot configure the generated-sources dir.
It's set to target/generated-sources/xdoclet/, so be sure to use that in
the xdoclet configuration (for the generated java files). For the META-INF
files like application.xml, ejb-jar.xml, web.xml etc., use
target/classes/META-INF/. There's currently no
separate 'generated-resources' directory it puts it in. This will be
fixed, and the directories will be configurable. For now, you should use
those defaults.

> (3) m2 can't find the maven-ear-plugin. According to the msg here
> http://marc.theaimsgroup.com/?l=turbine-maven-user&m=111962447408741&w=2
> it looks like I have to copy it from maven2/org/apache/maven/plugins to
> my local repository and change its directory structure. Is there a
> command line to get m2 to download it, so I then only have to change the
> dir?

As Brett said, no. In alpha-3, it was still in the sandbox, and not part
of the distribution. In beta-1 it is.

> At this point if I get an answer to any of these I'd be grateful.

Sorry for the late reply, and thanks for trying it out!

-- Kenney

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

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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


Re: [m2] alpha3 - xdoclet, compile, ear and install

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Brett Porter on 09/08/05 02:11, wrote:
>>(3) m2 can't find the maven-ear-plugin. According to the msg here
>>http://marc.theaimsgroup.com/?l=turbine-maven-user&m=111962447408741&w=2
>>it looks like I have to copy it from maven2/org/apache/maven/plugins to
>>my local repository and change its directory structure. Is there a
>>command line to get m2 to download it, so I then only have to change the
>>dir?
> 
> 
> No, not until it is released and deployed.

I manually downloaded it and set it up where my POM said it should be, 
and got it to work after some confusion between 
/org/apache/maven/plugins and /plugins/org/apache/maven, where my config 
errors were causing m2 to try to download it from non-existent 
repository dirs even though I had it in my local repo somewhere wrong. :O

I certainly learnt about the repo quite quickly.

Thanks for the help.

Adam


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


Re: [m2] alpha3 - xdoclet, compile, ear and install

Posted by Brett Porter <br...@gmail.com>.
Sorry for the late response, I figured Kenney would jump in.

On 7/29/05, Adam Hardy <ad...@cyberspaceroad.com> wrote:
> I'm putting together an EJB ear and I need some clarification on a
> couple of points.
> 
> (2) Even if I could get the xdoclet to run in m2, I can't figure out how
> to include a second source directory (containing the xdoclet generated
> classes). Is it just a comma-delimited list in the <sourceDirectory>
> attribute of the pom?

The xdoclet plugin should do this itself by calling
project.addCompileSourceRoot. You can only have one source directory
in your pom.

> (3) m2 can't find the maven-ear-plugin. According to the msg here
> http://marc.theaimsgroup.com/?l=turbine-maven-user&m=111962447408741&w=2
> it looks like I have to copy it from maven2/org/apache/maven/plugins to
> my local repository and change its directory structure. Is there a
> command line to get m2 to download it, so I then only have to change the
> dir?

No, not until it is released and deployed.

> 
> At this point if I get an answer to any of these I'd be grateful.

2/3, is that ok? :)

- Brett

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


Re: [m2] compiling from 2 different dirs

Posted by Jason van Zyl <ja...@maven.org>.
On Sun, 2005-07-31 at 14:51 +0100, Adam Hardy wrote:
> Sorry my mistake. maven-xdoclet-plugin is calling 
> project.addCompileSourceRoot() but in its current version, it does not 
> accept any config, and the default 
> ${project.build.directory}/generated-sources/xdoclet must be used.
> 
> Just for anyone searching the mail archives with this problem.

This is typically the pattern employed by plug-ins generating sources.
Where the output is directed to:

${project.build.directory}/generated-sources/<plugin-id>

-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

believe nothing, no matter where you read it,
or who has said it,
not even if i have said it,
unless it agrees with your own reason
and your own common sense.

 -- Buddha


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


Re: [m2] compiling from 2 different dirs

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Sorry my mistake. maven-xdoclet-plugin is calling 
project.addCompileSourceRoot() but in its current version, it does not 
accept any config, and the default 
${project.build.directory}/generated-sources/xdoclet must be used.

Just for anyone searching the mail archives with this problem.

Adam Hardy on 30/07/05 18:22, wrote:
> maven-xdoclet-plugin isn't calling project.addCompileSourceRoot()
> 
> Unfortunately.
> 
> How can I set this myself in my pom? I have played around with stuff 
> like this:
> 
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-compiler-plugin</artifactId>
>     <configuration>
>         <sourcePath>
>           src/main/java
>         </sourcePath>
>         <sourcePath>
>           ${project.build.directory}/generated-src
>         </sourcePath>
>     </configuration>
> </plugin>
> 
> but i either get a Failure executing javac (but could not parse the 
> error) or maven ignores it completely.
> 
> Is there a way to do this for 2 directories?
> 
> Adam
> 
> 
> Jesse McConnell on 29/07/05 19:48, wrote:
> 
>> well, the xdoclet plugin should be calling
>> project.addCompileSourceRoot( outputDirectory );
>>
>> in order to add the generated files to the compile phase..
>>
>> mostly these are generated into target/generated-sources I believe,
>> that why they are blown away with the default clean targets.  I don't
>> see source for the xdoclet plug in either mojo or the m2 repos though
>> so I can't say for sure.
>>
>> but yes, it is easy to do
>>
>>
>>
>> On 7/29/05, Adam Hardy <ad...@cyberspaceroad.com> wrote:
>>
>>> Adam Hardy on 28/07/05 16:39, wrote:
>>>
>>>> (2) Even if I could get the xdoclet to run in m2, I can't figure out 
>>>> how to include a second source directory (containing the xdoclet 
>>>> generated classes). Is it just a comma-delimited list in the 
>>>> <sourceDirectory> attribute of the pom?
>>>
>>>
>>> If I run xdoclet to generate some EJB code in a seperate directory (I 
>>> don't want it in the version control system), can I get maven to 
>>> compile it along with the normal code in src/main/java?
>>>
>>> As quoted in the paragraph above, I can't work out how to get m2 to do
>>> that.
>>>
>>> Or is it better to put it straight into the src/main/java tree with 
>>> the rest? I could always tell cvs to ignore it - although this would 
>>> be error prone.
> 
> 
> 
> ---------------------------------------------------------------------
> 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: compiling source code from 2 different dirs

Posted by Jesse McConnell <je...@gmail.com>.
well, the xdoclet plugin should be calling 

project.addCompileSourceRoot( outputDirectory );

in order to add the generated files to the compile phase..

mostly these are generated into target/generated-sources I believe,
that why they are blown away with the default clean targets.  I don't
see source for the xdoclet plug in either mojo or the m2 repos though
so I can't say for sure.

but yes, it is easy to do



On 7/29/05, Adam Hardy <ad...@cyberspaceroad.com> wrote:
> Adam Hardy on 28/07/05 16:39, wrote:
> > (2) Even if I could get the xdoclet to run in m2, I can't figure out how 
> > to include a second source directory (containing the xdoclet generated 
> > classes). Is it just a comma-delimited list in the <sourceDirectory> 
> > attribute of the pom?
> 
> If I run xdoclet to generate some EJB code in a seperate directory (I 
> don't want it in the version control system), can I get maven to compile 
> it along with the normal code in src/main/java?
> 
> As quoted in the paragraph above, I can't work out how to get m2 to do
> that.
> 
> Or is it better to put it straight into the src/main/java tree with the 
> rest? I could always tell cvs to ignore it - although this would be 
> error prone.
> 
> Thanks
> Adam
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 


-- 
--
jesse mcconnell

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


Re: [m2] compiling source code from 2 different dirs

Posted by Adam Hardy <ad...@cyberspaceroad.com>.
Adam Hardy on 28/07/05 16:39, wrote:
> (2) Even if I could get the xdoclet to run in m2, I can't figure out how 
> to include a second source directory (containing the xdoclet generated 
> classes). Is it just a comma-delimited list in the <sourceDirectory> 
> attribute of the pom?

If I run xdoclet to generate some EJB code in a seperate directory (I 
don't want it in the version control system), can I get maven to compile 
it along with the normal code in src/main/java?

As quoted in the paragraph above, I can't work out how to get m2 to do that.

Or is it better to put it straight into the src/main/java tree with the 
rest? I could always tell cvs to ignore it - although this would be 
error prone.

Thanks
Adam

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