Hei,

[I've found a work-around. Sending this to the list in case it saves
someone else's time]

I am trying to remove source:jar from being invoked and attaching the
sources.jar to the build without success.

The reason I don't want it is that when I run e.g.

  mvn --batch-mode release:prepare release:perform

the sources are attached twice, deployed twice and our artifact
repository complains and thus doesn't accept the build.

In particular I see

[INFO] [INFO] [source:jar-no-fork {execution: attach-sources}]
[INFO] [INFO] Building jar:
/home/jerome/Code/CHECKOUTS/maven-test-trunk/target/checkout/core/target/core-1.6-sources.jar
[INFO] [INFO] Preparing source:jar
[INFO] [WARNING] Removing: jar from forked lifecycle, to prevent
recursive invocation.
[INFO] [INFO] [source:jar {execution: attach-sources}]

I wasn't able to prevent the source:jar plugin to run, but I managed
to desactivate it using

              <attach>false</attach>

Full config below.

Here's some related links/issues:
* http://jira.codehaus.org/browse/MNG-3119
* http://jira.codehaus.org/browse/MSOURCES-13
* http://maven.apache.org/plugins/maven-source-plugin/usage.html
* bottom of 
http://old.nabble.com/Removing:-jar-from-forked-lifecycle,-to-prevent-recursive-invocation-td22054923.html



Details:
********
My pom structure is as follow:

* corporate-super-pom (no <plugin> configuration)
* team-super-pom references source-jar in a couple of places

<project>
  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.1.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <execution
          <execution>
            <id>attach-sources2</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <attach>false</attach>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

* project pom


With or without the second execution, the source:jar mojo is still
executed and causes my deployment to fail. attach=false was the only
way I found to prevent it from attaching the sources.

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to