apache / servicecomb-pack

Apache ServiceComb Pack is an eventually data consistency solution for micro-service applications. ServiceComb Pack currently provides TCC and Saga distributed transaction co-ordination solutions by using Alpha as a transaction coordinator and Omega as an transaction agent .
https://servicecomb.apache.org/
Apache License 2.0
1.93k stars 435 forks source link

Note the following points when compiling the code: #679

Open RuthlessStar opened 3 years ago

RuthlessStar commented 3 years ago

1 Compile the code and run the relevant unit tests. As there may be errors in the unit tests, the compilation may be terminated. You can ignore the test errors. Use the following method to add the following code to the pom project (I added it on line 843)

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <testFailureIgnore>true</testFailureIgnore>
        </configuration>
      </plugin>

If you don’t want to ignore the test error every time, you can add ignore in the run command, as follows mvn clean install -Dmaven.test.failure.ignore=true 2 Pay attention to your jdk version, make sure it is 1.8 3 Compile the software release package, do not run the test, maven will encounter problems with the release package generated in the distribution/target directory Cannot run program "gpg.exe" Can be solved in the following ways (1) Add compilation parameter -Dgpg.skip (2) Modify pom to delete gpg plugin and use package to compile , the command is mvn clean package

 <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-gpg-plugin</artifactId>
  <version>1.6</version>
  <executions>
    <execution>
      <id>sign-artifacts</id>
      <phase>verify</phase>
      <goals>
        <goal>sign</goal>
      </goals>
    </execution>
  </executions>
</plugin>

(3) However, there are certain problems with the above processing methods. First, GPG signature is necessary, so it cannot be done by deleting the configuration. But we know that GPG signature is only necessary when the project is released, otherwise it will be time-consuming, so you can use the release-profile to add gpg attributes. At the same time delete the original gpg configuration.

 <profile>
        <id>release-sign-artifacts</id>
        <activation>
            <property>
                <name>performRelease</name>
                <value>true</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactid>maven-gpg-plugin</artifactid>
                    <version>1.0</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>