You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andreas Höhmann (JIRA)" <ji...@apache.org> on 2019/01/11 11:10:00 UTC

[jira] [Commented] (MINSTALL-151) Projects without primary artifacts, but with attachment artifacts fail install

    [ https://issues.apache.org/jira/browse/MINSTALL-151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740289#comment-16740289 ] 

Andreas Höhmann commented on MINSTALL-151:
------------------------------------------

{noformat}
<profile>
  <id>ca01</id>
  <build>
    <pluginManagement>
      <plugins>
        <!-- Override version for maven-install-plugin because there is a bug in 3.0.0-M1 preventing installing of ca01-war's -->
        <!-- See: https://issues.apache.org/jira/browse/MINSTALL-151 -->
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <!-- Override version for maven-deploy-plugin because there is a similar bug in 3.0.0-M1 like the install-plugin -->
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exlude>logback.xml</exlude>
            <exlude>**/.gitignore</exlude>
            <exlude>.gitignore</exlude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <classifier>ca01</classifier>
          <archiveClasses>true</archiveClasses>
          <attachClasses>true</attachClasses>
          <classesClassifier>ca01-classes</classesClassifier>
              <webResources>
                <resource>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>jetty-env.xml</include>
                  </includes>
                  <targetPath>WEB-INF</targetPath>
                </resource>
          </webResources>
          <packagingExcludes>
                WEB-INF/classes,
                WEB-INF/lib/commons-logging*.jar,
                WEB-INF/lib/log4j*.jar,
                WEB-INF/lib/jcl-over-slf4j*,
                WEB-INF/lib/jul-to-slf4j*.jar,
                WEB-INF/lib/slf4j*.jar,
                WEB-INF/lib/logback*.jar,
                WEB-INF/lib/el-impl*.jar,
                WEB-INF/jetty-web.xml,
                WEB-INF/.faces-config.xml.jsfdia,
                **/.gitignore
          </packagingExcludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-ca01-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/src/main/ca01/java/</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-ca01-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>${basedir}/src/main/ca01/resources/</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>add-ca01-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/src/test/ca01/java/</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-ca01-test-resources</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>add-test-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>${basedir}/src/test/ca01/resources/</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</profile>
{noformat}

With that we are able to build the same web-application in 2 different "flavors" 
- online version
- and "ca01 version" -> a kind of offline version

(?) how should I configure install/deploy to archive the same results as with the "old" maven plugins?


> Projects without primary artifacts, but with attachment artifacts fail install
> ------------------------------------------------------------------------------
>
>                 Key: MINSTALL-151
>                 URL: https://issues.apache.org/jira/browse/MINSTALL-151
>             Project: Maven Install Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0-M1
>            Reporter: Peter Huffer
>            Priority: Major
>         Attachments: minstall-151.zip
>
>
> I have a module which has a packaging of {{feature}} from the {{karaf-maven-plugin}}. When running the {{mvn install}} command, the following error occurs:
> {code:java}
> Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install) on project <project_name>: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]
> {code}
> Reverting back to version {{2.5.2}} made the {{mvn install}} command succeed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)