andi12 / msbuild-maven-plugin

Maven 3 plugin for building Visual Studio solutions and projects with msbuild
Apache License 2.0
5 stars 3 forks source link

Build not producing "main file" #39

Open sebastien-allard opened 1 year ago

sebastien-allard commented 1 year ago

Hi!

I'm trying to use this plugin, pretty neat!

It builds fine with VS.Net 2022 tools, but it fails the "install" with this error: "this project did not assign a main file to the project but it has attachments."

[INFO] <<< msbuild-maven-plugin:1.3.1:solution-package (default-solution-package) < package composantes-materielles-involve <<<

[INFO] --- msbuild-maven-plugin:1.3.1:test (default-test) composantes-materielles-involve --. Skipping test runner execution, path to CxxTest not set

[INFO] msbuild-maven-plugin:1.3.1:solution-package (default-solution-package) composantes-materielles-involve

[INFO] Parsing solution CC.Composantes with platform-x86, configuration=Release

[INFO] Solution parsing complete

[INFO] Project parsing complete [INFO] Building zip: C:\dev\workspace\composantes-materielles-involve\target\composantes-materielles-involve-5.2.0-SNAPSHOT-x86-Release.zip

[INFO] Attached artifact C:\dev\workspace\composantes-materielles-involve\target\composantes-materielles-involve-5.2.0-SNAPSHOT-x86-Release.zip

[INFO] --- msbuild-maven-plugin:1.3.1:cppcheck (default-cppcheck) @composantes-materielles-involve --- 

[INFO] Skipping static code analysis, path to CppCheck not set

[INFO] - msbuild-maven-plugin:1.3.1: vera (default-vera) composantes-materielles-involve Skipping coding style analysis, path to Vera++ home directory not set

[INFO] msbuild-maven-plugin:1.3.1:sonar (default-sonar) composantes-materielles-involve

[INFO] Skipping Sonar analysis, 'skip' set to true in the Sonar configuration.

 [INFO] maven-install-plugin:3.1.0: install (default-install) composantes-materielles-involve ---

[INFO] BUILD FAILURE

Total time: 16.668 s

[INFO] Finished at: 2022-12-30T13:15:37-05:00

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.1.0: install (default-install) on project composantes-materielles-involve: 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]

This is my config:

<plugin> 
<groupId>uk.org.raje.maven.plugins</groupId>
<artifactId>msbuild-maven-plugin</artifactId>
<version>1.3.1</version>
<extensions>true</extensions> <configuration>
<msbuildPath>${msBuild.path}</msbuildPath>
<projectFile>cc.Composantes.sln</projectFile> 
<platforms>
<platform>
<name>x86</name>
 <configurations>
<configuration>
<name>Release</name>
 </configuration>
</configurations>
</platform>
</platforms>
 </configuration>
</plugin>

Any suggestion?

andi12 commented 1 year ago

Could you try specifying an older version of the Maven install plugin:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>

There is an issue in this plugin as it doesn't specify a primary artifact which became required in the install plugin. See https://issues.apache.org/jira/browse/MINSTALL-151.

Last time I looked there wasn't a simply solution to solve this, if you find something feel free to create a PR.