本文介绍了在Maven发布期间,* sources.jar是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定我的插件中没有maven-source-plugin,但是在release:perform期间始终会生成[project-name] -sources.jar.在构建生命周期的其他阶段似乎并没有这样做.

I am certain that I do not have maven-source-plugin in my plugins, but a [project-name]-sources.jar is always getting built during release:perform. It doesn't seem to be doing it during other stages of the build life-cycle.

很遗憾,此[项目名称] -sources.jar已上传到我们的存储库(Nexus).管理层希望所有资源都保存在SVN中,并远离存储库.

Unfortunately, this [project-name]-sources.jar gets uploaded to our repository (Nexus). Management wants all sources to be kept in SVN and away from the repository.

我该怎么做?这当然不是组装问题.我们尝试了不同的构建配置文件,但[project-name] -sources.jar仍然保留.我们只是不希望在发行期间将任何源代码上传到存储库.

How do I do that? This is certainly not an assembly issue. We've tried different build profiles but the [project-name]-sources.jar still remained. We just don't want any source codes get uploaded to the repository during releases.

有人知道吗?

谢谢.

下面是我们在标记中使用的所有内容:

Below is all we use in the tag:

    <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
                <compilerArgument>-Xlint:all</compilerArgument>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>

        <!-- Release Reference: http://maven.apache.org/maven-release/maven-release-plugin/index.html -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.4.2</version>
            <configuration>
                <tagBase>http://some.url.here</tagBase>
                <checkModificationExcludes>
                    <checkModificationExclude>.classpath</checkModificationExclude>
                    <checkModificationExclude>.factorypath</checkModificationExclude>
                    <checkModificationExclude>.project</checkModificationExclude>
                    <checkModificationExclude>.rest-shell.log</checkModificationExclude>
                    <checkModificationExclude>.springBeans</checkModificationExclude>
                    <checkModificationExclude>.apt-generated/**</checkModificationExclude>
                    <checkModificationExclude>.settings/**</checkModificationExclude>
                    <checkModificationExclude>src\main\resources\rebel.xml</checkModificationExclude>
                </checkModificationExcludes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin> 
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <archive>
                    <index>true</index>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                    <manifestEntries>
                        <version>${project.version}</version>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

    </plugins>
</build>

推荐答案

因此,这是我自己的问题的答案,以防万一有人想知道解决方法:

So here is the answer to my own question in case anyone wants to know the work around:

    <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-release-plugin</artifactId>
    <configuration>
      ...
      <useReleaseProfile>false</useReleaseProfile>
      ...
    </configuration>
  </plugin>
</plugins>

这篇关于在Maven发布期间,* sources.jar是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 10:22