Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven 3 site descriptor issue : deploying artifact not working or site not building

I've migrated to maven 3.0.3 but I'm not able to build the maven site. In fact my project use an external parent pom that doesn't provide any site descriptor as artifact.

1- Is there a way to generate the maven site even if the parent doesn't provide a site.xml ? I can't make it work. "mvn site" command still crashing trying to download the site.xml of the parent with the following eroor (ArtifactResolutionException: Unable to locate site descriptor...)

2- How do we install or deploy the site.xml on maven repository. I try to add the following xml in my parent pom, but it's not installing anything in my local repo with mvn install command. I've a src/site/site.xml in my project, my project is a pom type project maven-site-plugin attach-descriptor attach-descriptor

UPDATE

No it's not working In my pom I have

<url>${site_url_pattern}</url>

<distributionManagement>
<site>
<id>test</id>
<url>file://${baseDir}../maven-site</url>
</site>
</distributionManagement>

In plugin management I put

<plugin>
<!-- Site plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>${encoding}</inputEncoding>
<outputEncoding>${encoding}</outputEncoding>
</configuration>
</plugin>

In plugins I put

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<!-- Manage site info part creation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin
</artifactId>
<version>2.2</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<offline>true</offline>
</configuration>
<reports>
<report>cim</report>
<!-- Dependencies report are consuming resources set MAVEN_OPTS=-Xmx1024m if java heap <report>dependencies</report> <report>dependencies-convergence</report> <report>dependencies-management</report> -->
<report>index</report>
<report>issue-tracking</report>
<!-- pb time generation on licence report <report>license</report> -->
<report>mailing-list</report>
<report>plugin-management</report>
<report>project-team</report>
<report>scm</report>
<report>summary</report>
</reports>
</plugin>
</reportPlugins>
</configuration>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>

I have a src/site/site.xml in the same project

When I do mvn site I still have

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:si
te (default-site) on project ner-delivery: SiteToolException: The site descripto
r cannot be resolved from the repository: ArtifactResolutionException: Unable to
 locate site descriptor: Could not transfer artifact com.sopragroup.evolan:evola
n-framework-superpom:xml:site_en:6.14.2 from/to Artifactory (http://pdtinteg.ptx
.fr.sopra/artifactory/repo): Access denied to: http://pdtinteg.ptx.fr.sopra/arti
factory/repo/com/sopragroup/evolan/evolan-framework-superpom/6.14.2/evolan-frame
work-superpom-6.14.2-site_en.xml
[ERROR] com.sopragroup.evolan:evolan-framework-superpom:xml:6.14.2

If I put manually a evolan-framework-superpom-6.14.2-site_en.xml on my local repo it's working, but that's not a real solution

like image 960
jandry Avatar asked Sep 13 '11 19:09

jandry


1 Answers

  1. Explicitly configure maven-site-plugin 3.0 in your pom:

      <pluginManagement>
        <plugin>
               <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <chmod>true</chmod>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
            </plugin>
        </pluginManagement>
    
  2. Add a url & a distributionManagement element that tell where you plan to deploy it.

  3. Add a src/site/site.xml that contains what you need.

If your parent has none of these, it will work.

like image 51
bmargulies Avatar answered Oct 01 '22 14:10

bmargulies