maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r306867 - in /maven/components/trunk/maven-site/src/site/apt/guides/suggestions: ./ non-standard-directories.txt
Date Thu, 06 Oct 2005 19:29:47 GMT
Author: jvanzyl
Date: Thu Oct  6 12:29:43 2005
New Revision: 306867

o adding suggestion by ashley williams which i will incorporate

  (with props)

Added: maven/components/trunk/maven-site/src/site/apt/guides/suggestions/non-standard-directories.txt
--- maven/components/trunk/maven-site/src/site/apt/guides/suggestions/non-standard-directories.txt
+++ maven/components/trunk/maven-site/src/site/apt/guides/suggestions/non-standard-directories.txt
Thu Oct  6 12:29:43 2005
@@ -0,0 +1,122 @@
+I posted these instructions a little while ago on how to use Maven 2  
+with a non
+standard single source tree rather than individual modules. Might be  
+useful for existing
+projects without the budget or inclination to move over to the  
+standard structure.
+Or maybe this technique would encourage a project to get an early  
+idea of how
+maven would work with their code before actually migrating to the  
+standard layout,
+with ilttle risk.
+I believe with just a few pom.xml tweaks I've managed to get  
+something of a single source project to work with maven. It could be  
+that a few bug fixes since Maven alpha have helped since the last  
+time I tried but here's what I did.
+1. Designed a bogus project consisting of a gui artifact that depends  
+on a util artifact each with a single class: and  
+respectively. Additionally the gui component uses a resource file  
+called I then arranged this project into the  
+following directory structure:
+--------acme [pom.xml]
+----------------util [, pom.xml]
+----------------gui [, pom.xml]
+------------------------resources []
+2. The gui and util poms only declare the acme/pom as a parent and  
+don't even have their own build section. The acme/pom.xml parent  
+contains the necessary tweaks that the child poms inherit, namely  
+inside the build section:
+   <modelVersion>4.0.0</modelVersion>
+   <groupId>com.acme</groupId>
+   <artifactId>app</artifactId>
+   <packaging>pom</packaging>
+   <version>1.0-SNAPSHOT</version>
+   <name>Acme Application</name>
+   <modules>
+     <module>util</module>
+     <module>gui</module>
+   </modules>
+   <build>
+     <sourceDirectory>.</sourceDirectory>
+     <resources>
+       <resource>
+         <directory>resources</directory>
+       </resource>
+     </resources>
+   </build>
+In other words the java files and resources/ directory are to be  
+found in the same directory as the pom.xml file for any given  
+artifact project.
+3. I ran the install phase as follows:
+ > cd com/acme
+ > m2 install
+which caused the target directories to be generated also at the same  
+level as each pom - for example com/acme/util/target and com/acme/gui/ 
+4. I examined the jar files in each target directory for example "jar  
+tvf com/acme/gui/target/gui-1.0-SNAPSHOT.jar" resulted in:
+which looks fine. I also ran "m2 site:site" as a random goal and that  
+seemed to work too, ie a target/site directory was created with all  
+the files correctly generated underneath.
+My conclusions are that it seems too easy so far and that I've missed  
+a howler - if somebody could point it out?? Also in the acme/pom.xml  
+file I would still need to add the equivalent test tags, eg  
+Would it be possible to encapsulate these tweaks and any others that  
+become apparent into a plugin so I could do something like the  
+following in any application (root) pom:
+   <plugins>
+     <plugin>
+       <groupId>com.maven.plugins</groupId>
+       <artifactId>project-structure</artifactId>
+       <version>1.0</version>
+       <configuration>
+         <method>one-tree</method>
+       </configuration>
+     </plugin>
+   </plugins>

Propchange: maven/components/trunk/maven-site/src/site/apt/guides/suggestions/non-standard-directories.txt
    svn:eol-style = native

Propchange: maven/components/trunk/maven-site/src/site/apt/guides/suggestions/non-standard-directories.txt
    svn:keywords = "Author Date Id Revision"

View raw message