gmaven没有为groovy代码生成jar文件

时间:2017-12-04 06:36:01

标签: java maven groovy gmaven

我正在使用GMaven插件在maven中编写我的groovy代码。当我做mvn干净安装它显示构建成功,但当我检查我的目标文件夹时,它不会为我生成任何jar。我在那个<{p>中引用了这个atlassian link

using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
     db.ISVCSP.Where(s => s.BeneficiaryId == beneficiaryId).ForEach(item =>
     {
          item.IsDeleted = true; 
     });
     await db.SaveChangesAsync();
     scope.Complete();
}

但为此我在<plugins> <plugin> <executions> <execution> <goals> <goal>generateStubs</goal> <goal>compile</goal> <goal>generateTestStubs</goal> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> </plugins> 上收到了pom错误。请帮帮我

下面是我的pom文件

execution

更新1:

我能看到jar,但它没有我的groovy代码

1 个答案:

答案 0 :(得分:0)

请你试试以下内容:

  <plugin>
    <groupId>org.codehaus.gmavenplus</groupId>
    <artifactId>gmavenplus-plugin</artifactId>
    <version>1.5</version>
    <executions>
      <execution>
        <goals>
          <goal>addSources</goal>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <sources>
        <source>
          <directory>${project.basedir}/src</directory>
          <includes>
            <include>**/*.groovy</include>
          </includes>
        </source>
      </sources>
    </configuration>
  </plugin>

实际上这就是我正在使用的并且jar正确生成

PS:确保source.directory指向.groovy文件存在的位置