maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Rosenberg <rosenberg.l...@gmail.com>
Subject Re: how can i have two compile phases?
Date Tue, 02 Nov 2010 13:16:44 GMT
Ok, first of all thank you for your time and let me understand what
the "maven way" means for me in this case:
I take the project and make 2 out of it, like
xyz-generators module and
xyz-generators-test module, as well as
xyz-runtime module.

Whenever I'm releasing xyz-generators they are actually untested,
because the test project can only test them after the released
happened.
Whenever I'm testing a new generator feature, I have to install
xyz-generators, switch to xyz-generators-test directory, run mvn
compile there - right?
I can not release xyz-generators and xyz-runtime in one package, one
have to maintain both dependencies.

on the plus side I could, at least theoretically, declare
xyz-generators dependency as provided. In the practice probably not.

The pluses aren't really outweigh drawbacks, apparently, in _this_
case, maven makes the life of the developer much harder as it should
be.

Do I miss any pluses ? :-)

regards
Leon

On Tue, Nov 2, 2010 at 12:25 PM, Stephen Connolly
<stephen.alan.connolly@gmail.com> wrote:
> You are fighting the "Maven way"
>
> Drink the coolaid, split your "two phases" into two projects and you
> will actually end up with a cleaner project in the first place... and
> a simpler build process... and it will be doing what you want
>
> Maven is opinionated... you have hit a core opinion, either use
> something else or follow the opinion.
>
> I suggest you try following the opinion and see where that takes
> you... I believe you'll have a cleaner structure that is _easier for
> others to maintain after you have moved on to projects elsewhere_ as
> well as easy for you to maintain going forwards
>
> -Stephen
>
> P.S. Maven aims to make building software easier for everyone working
> on the project to maintain, not just the person who set up the build
> process initially... the easiest tools for setting up a build process
> are not necessariliy the best tools for maintaining a build when the
> original build engineer moves elsewhere
>
> On 2 November 2010 10:22, Leon Rosenberg <rosenberg.leon@gmail.com> wrote:
>> Sorry, I was not able to answer to this message in the previous three days...
>>
>> If I understand your replies correctly, I cannot split the compile
>> phase into two with maven. This sounds pretty ... shitty ;-(
>>
>> regards
>> Leon
>>
>> On Fri, Oct 29, 2010 at 11:07 PM, Manfred Moser <manfred@mosabuam.com> wrote:
>>> You could move the code generator and the generated code out to a separate
>>> project. That will save you build time and solve your problem.
>>>
>>> manfred
>>>
>>>> Hi,
>>>>
>>>> I have following requirement. I have a project, in which I have one
>>>> source folder which contains a code generator (run with apt), another
>>>> source folder
>>>> which contains code, which is processed by the generator from folder
>>>> 1, and a third folder that relies on the code generated by the second
>>>> folder.
>>>> Therefor I need two compilation executions after each other, one for
>>>> the generator and one for the generated code.
>>>> Is this possible with maven?
>>>>
>>>> thanx in advance
>>>>
>>>> My pom file sofar:
>>>>
>>>> <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">
>>>>
>>>>   <parent>
>>>>       <groupId>net.anotheria</groupId>
>>>>       <artifactId>parent</artifactId>
>>>>       <version>1.1</version>
>>>>   </parent>
>>>>
>>>>   <modelVersion>4.0.0</modelVersion>
>>>>   <groupId>net.anotheria</groupId>
>>>>   <artifactId>distributeme</artifactId>
>>>>   <version>1.0.0-SNAPSHOT</version>
>>>>   <name>distributeme</name>
>>>>
>>>>   <build>
>>>>       <plugins>
>>>>                <plugin>
>>>>         <groupId>org.codehaus.mojo</groupId>
>>>>         <artifactId>build-helper-maven-plugin</artifactId>
>>>>         <executions>
>>>>           <execution>
>>>>             <id>add-source</id>
>>>>             <phase>generate-sources</phase>
>>>>             <goals>
>>>>               <goal>add-source</goal>
>>>>             </goals>
>>>>             <configuration>
>>>>               <sources>
>>>>                 <source>${project.basedir}/src/java</source>
>>>>                 <source>${project.basedir}/src/support</source>
>>>>                 <source>${project.basedir}/test/java</source>
>>>>               </sources>
>>>>             </configuration>
>>>>           </execution>
>>>>         </executions>
>>>>       </plugin>
>>>>       <plugin>
>>>>         <groupId>org.codehaus.mojo</groupId>
>>>>         <artifactId>apt-maven-plugin</artifactId>
>>>>         <version>1.0-alpha-3</version>
>>>>         <dependencies>
>>>>               <dependency>
>>>>                       <groupId>org.jfrog.maven.annomojo</groupId>
>>>>                       <artifactId>maven-plugin-tools-anno</artifactId>
>>>>                       <version>1.3.1</version>
>>>>                       <exclusions>
>>>>                               <exclusion>
>>>>                                       <groupId>com.sun</groupId>
>>>>                                       <artifactId>tools</artifactId>
>>>>                               </exclusion>
>>>>                       </exclusions>
>>>>               </dependency>
>>>>               <dependency>
>>>>                   <groupId>org.codehaus.mojo</groupId>
>>>>               <artifactId>cobertura-maven-plugin</artifactId>
>>>>               <version>${cobertura-plugin.version}</version>
>>>>               </dependency>
>>>>
>>>>         </dependencies>
>>>>       <executions>
>>>>         <execution>
>>>>             <id>process</id>
>>>>               <goals>
>>>>                  <goal>process</goal>
>>>>               </goals>
>>>>               <phase>generate-sources</phase>
>>>>               <configuration>
>>>>                       <factory>org.distributeme.processors.GeneratorProcessorFactory</factory>
>>>>                       <encoding>UTF-8</encoding>
>>>>                               <verbose>true</verbose>
>>>>                               <outputDirectory>${project.basedir}/generated/java</outputDirectory>
>>>>                       </configuration>
>>>>         </execution>
>>>>       </executions>
>>>>       </plugin>
>>>>     </plugins>
>>>>   </build>
>>>>
>>>>     <reporting>
>>>>       </reporting>
>>>>
>>>>   <dependencies>
>>>>       <dependency>
>>>>               <groupId>net.anotheria</groupId>
>>>>               <artifactId>ano-util</artifactId>
>>>>               <version>1.0.0</version>
>>>>       </dependency>
>>>>       <dependency>
>>>>               <groupId>net.anotheria</groupId>
>>>>               <artifactId>ano-net</artifactId>
>>>>               <version>1.0.0</version>
>>>>       </dependency>
>>>>       <dependency>
>>>>               <groupId>net.anotheria</groupId>
>>>>               <artifactId>ano-prise</artifactId>
>>>>               <version>1.0.2</version>
>>>>       </dependency>
>>>>       <dependency>
>>>>               <groupId>net.anotheria</groupId>
>>>>               <artifactId>configureme</artifactId>
>>>>               <version>1.0.0</version>
>>>>       </dependency>
>>>>       <dependency>
>>>>       <groupId>javax.servlet</groupId>
>>>>       <artifactId>servlet-api</artifactId>
>>>>       <version>2.5</version>
>>>>       <scope>provided</scope>
>>>>       </dependency>
>>>>       <dependency>
>>>>               <groupId>jdom</groupId>
>>>>               <artifactId>jdom</artifactId>
>>>>               <version>0.7</version>
>>>>       </dependency>
>>>>       <dependency>
>>>>               <groupId>com.sun</groupId>
>>>>               <artifactId>tools</artifactId>
>>>>               <version>1.6</version>
>>>>               <scope>provided</scope>
>>>>       </dependency>
>>>>
>>>>   </dependencies>
>>>>
>>>>
>>>>
>>>>       <scm>
>>>>               <url>svn:svn://svn.anotheria.net/opensource/distributeme/trunk</url>
>>>>               <connection>scm:svn:svn://svn.anotheria.net/opensource/distributeme/trunk</connection>
>>>>               <developerConnection>scm:svn:svn://svn.anotheria.net/opensource/distributeme/trunk</developerConnection>
>>>>       </scm>
>>>>
>>>> </project>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


Mime
View raw message