Hi,

On 8/8/15 6:04 PM, org.apache.maven.u...@io7m.com wrote:
Hello.

I'm trying to reduce the redundancy of my existing POM files with
inheritance. I've run into an issue with the generated sites.

The parent pom:

   http://waste.io7m.com/2015/08/08/jnull.pom

A submodule pom:

   http://waste.io7m.com/2015/08/08/jnull-core.pom

The deployed site, note the correct URI for the source repository (not
actually uploaded to GitHub yet):

The first thing which i saw where the wrong SCM connections given:


 <scm>
    <url>http://github.com/io7m/jnull</url>
    <connection>scm:git:git://github.com/io7m/jnull</connection>

<developerConnection>scm:git:git://github.com/io7m/jnull</developerConnection>
  </scm>


But they should like this:

 <scm>
    <url>http://github.com/io7m/jnull</url>
    <connection>scm:git:git://github.com/io7m/jnull.git</connection>

<developerConnection>scm:git:git://github.com/io7m/jnull.git</developerConnection>
  </scm>


Apart from that it would be helpfull to know which Maven version you are using? How have you Maven called to generate the site ?




   http://waste.io7m.com/2015/08/08/staging/source-repository.html


I have taken a look at the two pom (parent)...

The first thing i stumbled over was the ssh-extension you are defining? So are you really trying to deploy via ssh your maven artifacts? Apart from that why are you using such an old version? There are newer versions available: http://maven.apache.org/wagon/

Furthermore i have seen that you define plugins in your parent like this:

  <build>
    <plugins>
      <!-- Plugin versions -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.6.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.7</version>
      </plugin>
    </plugins>

Which should be done like this:

<build>
  <pluginManagement>
    <plugins>
      <plugin>..
      </plugin>...
    </plugins>
  </pluginManagement>
</build>

which brings me to the next point you have defined the maven-compiler-plugin in your jnull-core module like this:

 <build>
    <plugins>
      <!-- Require JDK >= 1.6 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

So this should be done in the parent by this:

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

And then you can remove the definition of this in every submodule...
Also the definition of maven-jar-plugin which you did in the submodule (jnull-core):

      <!-- Produce custom manifest in jar files -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Specification-Title>${project.name}</Specification-Title>

<Specification-Version>${project.version}</Specification-Version>
              <Specification-Vendor>io7m.com</Specification-Vendor>
              <Implementation-Title>${project.name}</Implementation-Title>

<Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>io7m.com</Implementation-Vendor>

<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
              <Built-By>io7m</Built-By>
              <Sealed>true</Sealed>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

Should be done only in the parent only once within the pluginManagement block...Furthermore if i correctly see you define the manifiest with default entries which can be simplyfied by using this:

      <!-- Produce custom manifest in jar files -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>

<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
          </archive>
        </configuration>
      </plugin>

See the docs of the archiver:
http://maven.apache.org/shared/maven-archiver/index.html which is referenced from the doc site of the maven-jar-plugin:
https://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html

I have seen also that you define the maven-sources-plugin in your core module like this:

 <!-- Create source jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <archive>
                <manifestEntries>

<Specification-Title>${project.name}</Specification-Title>

<Specification-Version>${project.version}</Specification-Version>
                  <Specification-Vendor>io7m.com</Specification-Vendor>

<Implementation-Title>${project.name}</Implementation-Title>

<Implementation-Version>${project.version}</Implementation-Version>
                  <Implementation-Vendor>io7m.com</Implementation-Vendor>

<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                  <Built-By>io7m</Built-By>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

Apart from the manifest part as mentioned for the maven-jar-plugin you have defined explicit executions with binding to life cycle which is not neccessary cause maven-sources-plugin is already bound to the life cycle....And you should prevent using the goal 'jar' cause it will fork the life cycle...Are you sure making source packages of your test code ?



Also i have found a thing in your parent pom:

  <prerequisites>
    <maven>2.2.1</maven>
  </prerequisites>

So i can give you a hint to read this:

http://blog.soebes.de/blog/2015/04/04/maven-prerequisites/



Kind regards
Karl Heinz Marbaise

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

Reply via email to