How to enable Maven "Packaging for this project did not assign an artifact assembly error file"?

Im using Maven 3.2.3. Previously, I could run "mvn clean install" in my WAR project, and the WAR will be installed in my local repository. However, I recently added a configuration so that my WAR is built in place (config below). Now when i run

mvn clean install

I get an error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.5.2:install (install) on project myproject: The packaging for this project did not assign a file to the build artifact -> [Help 1]

How to fix it? I tried to make the maven-install-plugin target the default one, but that didn't help. Below is my Maven configuration ...

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>${project.basedir}/src/main/webapp/WEB-INF/classes</directory>
                            </fileset>
                            <fileset>
                                <directory>${project.basedir}/src/main/webapp/WEB-INF/lib</directory>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <useCache>true</useCache>
                        <workDirectory>/tmp/${project.artifactId}/war/work</workDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-war</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>war-inplace</id>
                            <phase>package</phase>
                            <goals>
                                <goal>inplace</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                    <executions>
                        <execution>
                            <id>default-install</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>install</id>
                            <phase>install</phase>
                            <goals>
                                <goal>install</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
+4
source share
1 answer

Adding an entry below rpm

    %_rpmfilename noarch/%%{NAME}-%%{VERSION}-%%{RELEASE}.noarch.rpm

, , . ( 64 ).

    vim /etc/rpm/macros
    vim ~/.rpmmacros
-1

Source: https://habr.com/ru/post/1584496/


All Articles