Stephen, Thank you very much for the detailed answer.
Hung- Stephen Connolly-2 wrote: > > Move the configuration to inside the execution. > > The packaging parameter is read-only for install:install but not for > install:install-file... therefore you want your configuration to apply to > the install-file execution only. > > -Stephen > > P.S. your approach will have many problems. While you are installing the > file into the local repository, it is not attached as part of the reactor, > so it will not get deployed, and you will be unable to run the "clean > verify" goals whenever the versions have been changed, or on a system > which > has never ran the install goal for the current project version... this > essentially will cause problems with the release plugin. > > I normally use two techniques to work around these issues: > > 1. create a dummy pom for the jar I want to add with packaging pom and use > buildhelper to attach the jar to the project... > > 2. create a dummy pom for the jar I want to add with packaging jar and use > antrun to copy the jar over the built jar between the package and install > phases > > #1 is quicker, but #2 gives you a pom with the correct packaging > > > 2009/7/2 hhuynh <[email protected]> > >> >> Hi all, >> >> I've configured install plugin to install additional file (created by the >> assembly plugin from the same project). Settings is as below. However, >> the >> very last step of installing the main artifact, I got this error >> >> ERROR: Cannot override read-only parameter: packaging in goal: >> install:install >> >> Any idea why and how to work around it? >> >> Thanks, >> >> Hung- >> >> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-install-plugin</artifactId> >> <version>2.3</version> >> <configuration> >> <file>target/${standalone-jar-name}.jar</file> >> <packaging>jar</packaging> >> <groupId>org.terracotta.hibernate-cache</groupId> >> <artifactId>${standalone-jar-name}</artifactId> >> <version>${project.version}</version> >> </configuration> >> <executions> >> <execution> >> <id>install-standalone</id> >> <phase>install</phase> >> <goals> >> <goal>install-file</goal> >> </goals> >> </execution> >> </executions> >> </plugin> >> -- >> View this message in context: >> http://www.nabble.com/ERROR%3A-Cannot-override-read-only-parameter%3A-packaging-in-goal%3A-install%3Ainstall-tp24299872p24299872.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] >> >> > > -- View this message in context: http://www.nabble.com/ERROR%3A-Cannot-override-read-only-parameter%3A-packaging-in-goal%3A-install%3Ainstall-tp24299872p24312550.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]
