You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by hhuynh <hu...@yahoo.com> on 2009/07/02 03:57:39 UTC

ERROR: Cannot override read-only parameter: packaging in goal: install:install

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: ERROR: Cannot override read-only parameter: packaging in goal: install:install

Posted by hhuynh <hu...@yahoo.com>.
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 <hu...@yahoo.com>
> 
>>
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: ERROR: Cannot override read-only parameter: packaging in goal: install:install

Posted by Stephen Connolly <st...@gmail.com>.
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 <hu...@yahoo.com>

>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>