Hi Bro,
I have problem when install my project with dependency sonar-maven-plugin as follows :
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>busico</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>busico</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>assembly/assembly-linux.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<finalName>busico-gateway</finalName>
</build>
</profile>
<profile>
<id>windows</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>windows</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>assembly/assembly-windows.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<finalName>busico-gateway</finalName>
</build>
</profile>
</profiles>
When I run the command mvn -Pwindows clean install
, the jar package inside the final generated zip package is not executable。But the busico-gateway.jar in the target folder is executable。
jar in the targe folder looks like blow:
If I delete the sonar-maven-plugin dependency , the jar in the final zip package is executable.
Cause I want to set windows or Linux services to run the jar file , and Sonarqube to test the code, I don’t want to delete the dependency.
I can’t fix it for a long time! Can anyone help? Thanks very much