Shashi
Shashi

Reputation: 199

Maven build fails at site default-deploy

I have been struggling to fix my maven build issue from last 2 days with no success almost. Can you please help me on this?

  1. I have a parent pom.xml which looks like

    <distributionmanagement>
        Repository...
        Snapshot 
        <site>
            site config here..
        </site>
    </distributionmanagement>
    
  2. In child pom.xml, which I wrote works fine if I do 'mvn install'. tar file is created and appears in project/target folder. Looks good so far...

  3. When I do release the problem comes. The good thing is, it goes well till end - creates tar, uploads tar into my svn repository.. but after that maven is trying to read parent pom.xml and error comes while running "maven-site-plugin:default-deploy" and then "BUILD FAILURE"

What I'm thinking is - since tar is created and uploaded into subversion repository creating site & deploying is not required for us. How can I say to maven that once tar is created don't do anything and that's the end point for me. In other words - don't run anything 'site' related stuff for me?

========================= UPDATE

I have my release plugin config as below

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

we actually do release from our batch file which consists of mvn statements like below -

call mvn clean
call mvn install
call mvn -B release:prepare -DdryRun=true -DscmCommentPrefix="somecomment"
call mvn -B release:clean 
call mvn -B release:prepare -DscmCommentPrefix="somecomment"
call mvn -B release:perform -DscmCommentPrefix="somecomment"

Can you please suggest me now?

Upvotes: 0

Views: 584

Answers (2)

Ilayna
Ilayna

Reputation: 1

Or if creating site & deploying is really not required (as you say in your question), you could just remove the <distributionManagement> section. According to the docs default goals are "either deploy or deploy site-deploy, if the project has a <distributionManagement>/<site> element".

http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html

Upvotes: 0

khmarbaise
khmarbaise

Reputation: 97389

You should change the maven-release-plugin configuration no to do an site-deploy which is default like the following:

  <plugin>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.4.1</version>
    <configuration>
      <goals>deploy</goals>
    </configuration>
  </plugin>

Upvotes: 1

Related Questions