IMHO, it is not a feature enhancement, but a bug of the plugin. Why would you generate sources and not want them to be added to the compile paths? You don't want to configure it twice. Even not once. ;) So yes, the build-helper-plugin is necessary unfortunately, but it should not be added to the compiler plugin. Other plugins also could use the source directories, like the Javadoc plugin (I'm not 100% sure, but I guess it uses them). If you use the build-helper-plugin, also the javadoc plugin takes advantage.

Hth,

Nick Stolwijk

Pankaj Tandon wrote:
Thanks Jeff and Nick.
The use of build-helper did the trick.
Altho it seems that if this plugin is used ONLY for adding sources, there
should be a config parameter added to the maven-compiler-plugin. Don't see
why a whole new plugin is needed for something that seems to be a feature
enhancement to an existing plugin.

Thanks anyway!

Pankaj


nicklist wrote:
AFAIK, the compiler plugin won't take the classes from
target/generated-sources itself, but only when the generating plugin add
that folder to the compile directories of a project. project.addCompileSourceRoot(sourceDirectoryPath);
The weblogic plugin doesn't do this. I guess, the weblogic plugin compiles
the classes, but I'm not sure of that.

Also, the default folder for generated sources is not
target/generated-sources, but target/generated-sources/anyPluginName, so
multiple plugins are not in each others way.

Try the maven-build-helper to add your source folder to the compiler. It
should work.

Hth,

Nick Stolwijk

-----Original Message-----
From: Pankaj Tandon [mailto:[EMAIL PROTECTED]
Sent: Thu 1/3/2008 5:01 PM
To: [email protected]
Subject: Re: generated-sources class files not in final artifact
OK, if I were to use the maven-build-helper plugin, the only configuration
I
see there is the add-source goal with the sources folder specifying where
the source folder is.
I don't see where I can specify the target folder so that the compiled
classes go into target/classes to be bundled in the artifact.
Can you please explain how I can use the maven-build-helper plugin to have
my classes compiled into target/classes.

Also, I am a bit puzzled why you are surprised by classes being compiled.
The compile phase will compile all java classes in
${builddir}/src/main/java
into target/classes AND it also picks up files in target/generated-sources
and compiles them. Now if there was a way to specify where to place the
result of that compilation, I would have my answer. I tried to look in the
configuration of maven-compiler-plugin but do not see any configuration
param there that will tell it to place the compiled source from
generated-sources into target/classes.

Thanks
Pankaj


Jeff MAURY wrote:
I don't see why Maven will compile these files in this directory. Maybe
the
compilation is done by the clientgen task. So I persist adding the target
directory with the maven-build-helper plugin.

Jeff


On Jan 3, 2008 4:19 PM, Pankaj Tandon <[EMAIL PROTECTED]> wrote:

If I remove the outputDir parameter to the weblogic-maven-plugin, the
sources
will go into ${basedir}/src/main/java.
That immediately presents a problem because of:
1/ source control constantly detects these files as modified and
2/ the inability to do a mvn clean. (mvn clean will not remove the
clientgen
source from src/main/java).

I also confirmed that these files DO get compiled but in the same
location
(that is, in generated-sources). All I want is that these files get
compiled
in target/classes like the rest of the source under src/main/java

Thanks
Pankaj




Jeff MAURY wrote:
For me, you generated sources are not compiled. Remove the outputDir
parameter and they will be compiled as the default is to generate in
the
standard Java source directory.

Jeff


On Jan 3, 2008 3:09 PM, Pankaj Tandon <[EMAIL PROTECTED]> wrote:

Here is the pom:

<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>com.crowncastle</groupId>
 <artifactId>bpm-common</artifactId>
 <packaging>jar</packaging>
 <version>1.0-SNAPSHOT</version>
 <name>bpm-common</name>
 <url>http://www.crowncastle.com</url>
 <parent>
       <groupId>com.crowncastle</groupId>
       <artifactId>bpm</artifactId>
       <version>1.0-SNAPSHOT</version>
 </parent>



 <build>
       <plugins>
      <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>weblogic-maven-plugin</artifactId>
       <version>2.9.0-SNAPSHOT</version>
               <executions>
                 <execution>
                   <phase>generate-sources</phase>
                       <configuration>



<inputWSDL>file:///${basedir}/src/main/resources/operations.wsdl</inputWSDL>
<outputDir>${project.build.directory}/generated-sources</outputDir>
                         <packageName>com.crowncastle.ws.operation
</packageName>
                         <serviceName>OperationService</serviceName>
                       </configuration>
          <goals>
            <goal>clientgen</goal>
          </goals>
        </execution>
      </executions>
       <dependencies>
               <dependency>
                       <groupId>com.sun.java</groupId>
                       <artifactId>tools</artifactId>
                               <version>1.0</version>
               </dependency>
               <dependency>
                       <groupId>weblogic</groupId>
                       <artifactId>weblogic</artifactId>
                               <version>9.2</version>
               </dependency>
               <dependency>
                       <groupId>weblogic</groupId>
                       <artifactId>webservices</artifactId>
                               <version>9.2</version>
               </dependency>

       </dependencies>

     </plugin>







       </plugins>
 </build>

 <dependencies>
 <dependency>
   <groupId>org.json</groupId>
   <artifactId>json</artifactId>
   <version>20070829</version>
 </dependency>
 </dependencies>


</project>


And here is the output when run:

D:\projects\BPM>mvn install -Denv=dev-2

D:\projects\BPM>set MAVEN_OPTS=-Xms512m -Xmx1400m
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   bpm
[INFO]   bpm-common
[INFO]   bpm-service
[INFO]   bpm-siteinspection-web
[INFO]

-------------------------------------------------------------------------
---
[INFO] Building bpm
[INFO]    task-segment: [install]
[INFO]

-------------------------------------------------------------------------
---
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing D:\projects\BPM\pom.xml to
D:\mavenLocalRepo2\com\crowncastle\
bpm\1.0-SNAPSHOT\bpm-1.0-SNAPSHOT.pom
[INFO]

-------------------------------------------------------------------------
---
[INFO] Building bpm-common
[INFO]    task-segment: [install]
[INFO]

-------------------------------------------------------------------------
---
[INFO] artifact weblogic:weblogic: checking for updates from
codehaus.org
[INFO] artifact weblogic:weblogic: checking for updates from central
[INFO] artifact weblogic:weblogic: checking for updates from Maven
JBoss
Repo
[INFO] artifact weblogic:weblogic: checking for updates from
crownRepo
[INFO] artifact weblogic:webservices: checking for updates from
codehaus.org
[INFO] artifact weblogic:webservices: checking for updates from
central
[INFO] artifact weblogic:webservices: checking for updates from Maven
JBoss
Repo

[INFO] artifact weblogic:webservices: checking for updates from
crownRepo
[INFO] [weblogic:clientgen {execution: default}]
[INFO] Weblogic client gen beginning
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note:

D:\projects\BPM\bpm-common\target\generated-sources\com\crowncastle\ws\ope
ration\OperationPortType_Stub.java uses unchecked or unsafe
operations.
Note: Recompile with -Xlint:unchecked for details.
[INFO] Weblogic client gen successful
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 51 source files to
D:\projects\BPM\bpm-common\target\classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
D:\projects\BPM\bpm-common\target\bpm-common-1.0-SNAPSHOT.j
ar
[INFO] [install:install]
[INFO] Installing
D:\projects\BPM\bpm-common\target\bpm-common-1.0-SNAPSHOT.jar
to
D:\mavenLocalRepo2\com\crowncastle\bpm-common\1.0-SNAPSHOT\bpm-
common-1.0-SNA
PSHOT.jar
[INFO]

-------------------------------------------------------------------------
---
[INFO] Building bpm-service
[INFO]    task-segment: [install]
[INFO]

-------------------------------------------------------------------------
---
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 15 source files to
D:\projects\BPM\bpm-service\target\classes
[INFO]

------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]

------------------------------------------------------------------------
[INFO] Compilation failure



D:\projects\BPM\bpm-service\src\main\java\com\crowncastle\bpm\siteinspection\ser
vices\PAPIService.java:[35,33] package com.crowncastle.ws.common does
not
exist



D:\projects\BPM\bpm-service\src\main\java\com\crowncastle\bpm\siteinspection\ser
vices\PAPIService.java:[36,36] package
com.crowncastle.ws.operationdoes
not
exi
st



D:\projects\BPM\bpm-service\src\main\java\com\crowncastle\bpm\siteinspection\ser
vices\PAPIService.java:[37,36] package
com.crowncastle.ws.operationdoes
not
exi
st



D:\projects\BPM\bpm-service\src\main\java\com\crowncastle\bpm\siteinspection\ser
vices\PAPIService.java:[38,36] package
com.crowncastle.ws.operationdoes
not
exi
st


[INFO]

------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]

------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Thu Jan 03 07:58:54 EST 2008
[INFO] Final Memory: 19M/508M
[INFO]

------------------------------------------------------------------------
Since the classes in generated-sources are NOT complied into
target/classes
(but compiled into generated-sources itself), those classes are not
included
in the final artifact bpm-common-1.0-SNAPSHOT.jar and so the next
project
(bpm-service) which is dependent on this artifact, fails.


Thanks,
Pankaj



Jeff MAURY wrote:
Can you send us the pom or the output of Maven ?

Jeff


On Jan 3, 2008 2:05 PM, Pankaj Tandon <[EMAIL PROTECTED]>
wrote:
Hi,
Thanks for that suggestion. I did try that but it did not help for
two
reasons.
1/ generated-sources is automatically picked up by the compiler
with
or
without the build:helper plugin
2/It is the location of the compiled classes that I need to be
changed
to
target/classes. Rightnow, the compiled classes go to the same
source
folder
(generated-sources) and hence do not get bundled in the final
artifact.
Any other suggestions?

Thanks!

Pankaj


Jeff MAURY wrote:
You can use maven-build-helper-plugin to add generated-sources
to
the
list
of source directories. See
http://mojo.codehaus.org/build-helper-maven-plugin

Jeff

On Jan 3, 2008 2:49 AM, Pankaj Tandon <[EMAIL PROTECTED]>
wrote:
Hi,
I'm using weblogic-maven-plugin to generate client stubs (using
the
clientgen goal). The client stubs are correctly generated in
the
generated-sources folder as specified in the plugin.

Also, as expected, the generated-sources folder is detected by
the
complier
and along with the java files under  src/main/java, the
generated
source
under generated-source is also compiled.
However, the source under generated-source is compiled right in
the
generated-sources folder instead of target/classes.
As a result, the classes under generated-sources do not make it
into
the
final artifact (jar).

How can I make the classes under generated-sources compile
under
target/classes?

Thanks

Pankaj

--
View this message in context:

http://www.nabble.com/generated-sources-class-files-not-in-final-artifact-tp14590265s177p14590265.html
Sent from the Maven - Users mailing list archive at Nabble.com.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com


--
View this message in context:

http://www.nabble.com/generated-sources-class-files-not-in-final-artifact-tp14590265s177p14596588.html
Sent from the Maven - Users mailing list archive at Nabble.com.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com


--
View this message in context:

http://www.nabble.com/generated-sources-class-files-not-in-final-artifact-tp14590265s177p14597526.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com


--
View this message in context:
http://www.nabble.com/generated-sources-class-files-not-in-final-artifact-tp14590265s177p14598566.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com


--
View this message in context:
http://www.nabble.com/generated-sources-class-files-not-in-final-artifact-tp14590265s177p14599737.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to