maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Tinnefeld (JIRA)" <j...@codehaus.org>
Subject [jira] Issue Comment Edited: (MNG-4120) Profile activation should be per module
Date Wed, 01 Apr 2009 10:01:12 GMT

    [ http://jira.codehaus.org/browse/MNG-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=171685#action_171685
] 

Karsten Tinnefeld edited comment on MNG-4120 at 4/1/09 5:00 AM:
----------------------------------------------------------------

In order to deliver configuration files etc. with the other project artifacts, I had this
defined in a profile attached to my master configuration pom in a large-scale banking portal
project. The idea is that this automatically copies the project attachments to the target
directory whenever src/main/attachments exists.

				<plugin>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.3</version>
					<executions>
						<execution>
							<id>copy-attachments</id>
							<goals>
								<goal>run</goal>
							</goals>
							<phase>process-resources</phase>
							<configuration>
								<tasks>
									<copy preservelastmodified="true" todir="${project.build.directory}"
										flatten="true">
										<fileset dir="${basedir}/src/main/attachments"
											includes="**/*" />
										<regexpmapper from="^(.*)$$"
											to="${project.artifactId}-${project.version}-\1" />
									</copy>
								</tasks>
							</configuration>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>org.apache.ant</groupId>
							<artifactId>ant-nodeps</artifactId>
							<version>1.7.1</version>
						</dependency>
					</dependencies>
				</plugin>

I would then attach these artifacts (did not yet figure out a generic way for it) in the concrete
projects, e.g. a log4j configuration:

		<plugins>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-supplemental</id>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>
										target/${project.artifactId}-${project.version}-log4j.xml
									</file>
									<type>xml</type>
									<classifier>log4j</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>

Hope, this helps.

      was (Author: tinne):
    Second try.
  
> Profile activation should be per module
> ---------------------------------------
>
>                 Key: MNG-4120
>                 URL: http://jira.codehaus.org/browse/MNG-4120
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Dependencies, POM
>    Affects Versions: 2.0.9
>            Reporter: Karsten Tinnefeld
>
> In a multi-module-project, one might wish to run certain targets dependent on the existance
of some file or directory.
> In a single-module-project, I'd say
> <profiles><profile><id>do-if-file-exists</id>
> <activation><exists>some/special/path</exists></activation>
> <plugins><!-- my specific configuration --></plugins></profile></profiles>
> This however does not work on a per-module base in a multi-module project, but the profile
is (de)activated depending on the situation on the run pom only, and this is not even documented.
> In my opinion, profile activation should be on a per-module basis.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message