我在 Gitlab 上创建了一个项目并将其克隆到我的计算机上。所以我本地只有一个分支(master)(git branch只显示master)。一位同事创建了一个新分支。所以现在 Gitlab 上有 2 个分支,但我的电脑上没有。
我该怎么做才能让我的同事在我的计算机上创建分支,以便同时git branch显示master和 new-branch?
谢谢你。
我不明白,我尝试用 JaCoCo 和 Maven 生成代码覆盖率报告,最简单的。
我的 pom.xml 中有以下插件:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>target/jacoco.exec</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>target/my-reports</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当我尝试进行 mvn 测试时,它什么也没做。甚至没有错误或其他什么。它说为我的测试构建成功,但 Maven 似乎没有看到 JaCoCo。如果我尝试执行 mvn jacoco:report 无论如何我都会收到一条消息:Skipping JaCoCo execution …
我想为已经在 GitLab 上的Java 项目发布代码覆盖率报告。我使用 JaCoCo 在位于app/target/site/jacoco/.
我看到我必须激活 GitLab 页面。但是GitLab 文档上的这个链接说我必须创建一个新项目。我的 Java 项目已经在 GitLab 项目中,我不知道在这种情况下该怎么做。