write a shell script to do this kind of thing.
2008/10/6 Simone Tripodi <[EMAIL PROTECTED]>
> Hi everybody,
> In the company I'm in a situation where I need to iterate over all
> profiles and generate the relative artifact: to be more detailed, my
> application has many configuration files, structured as follow:
>
> src
> |
> \- main
> |
> \- config
> |
> \- local
> |
> \- *.properties, *.xml
>
> |
> \- stage
> |
> \- *.properties, *.xml
>
> |
> \- prod
> |
> \- *.properties, *.xml
>
> my pom contains some directives to use the config dir:
>
> <project>
> ...
> <profiles>
> <profile>
> <id>local</id>
> <activation>
> <activeByDefault>false</activeByDefault>
> </activation>
> <properties>
> <config>local</config>
> </properties>
> </profile>
> <profile>
> <id>stage</id>
> <activation>
> <activeByDefault>false</activeByDefault>
> </activation>
> <properties>
> <config>stage</config>
> </properties>
> </profile>
> <profile>
> <id>prod</id>
> <activation>
> <activeByDefault>false</activeByDefault>
> </activation>
> <properties>
> <config>prod</config>
> </properties>
> </profile>
> </profiles>
> ....
> <build>
> ...
> <plugins>
> ....
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <version>2.2</version>
> <configuration>
> <archive>
> <manifest>
>
> <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
>
> <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
> </manifest>
> </archive>
> </configuration>
> <executions>
> <execution>
> <configuration>
> <classifier>${config}</classifier>
> </configuration>
> <goals>
> <goal>jar</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> ...
> </plugins>
> ...
> <resources>
> <resource>
> <directory>src/main/config/${config}</directory>
> </resource>
> <resource>
> <directory>src/main/resources</directory>
> </resource>
> </resources>
> ...
> </build>
>
> </project>
>
> Now, launching on the shell
>
> mvn deploy -P <profile>
>
> a jar named 'modulename-version-<profile>.jar' will be deployed to my repo.
>
> Now my question is:
>
> is there a way to generate and deploy ALL artifacts FOR EACH profile?
> I'm using also the release plugin and my wish is releasing the module
> for each configuration!
>
> Many thanks in advance!!!
> Best regards,
> Simone
>
> --
> My LinkedIn profile: http://www.linkedin.com/in/simonetripodi
> My GoogleCode profile: http://code.google.com/u/simone.tripodi/
> My Picasa: http://picasaweb.google.com/simone.tripodi/
> My Tube: http://www.youtube.com/user/stripodi
> My Del.icio.us: http://del.icio.us/simone.tripodi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>