You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marc Claessens (JIRA)" <ji...@codehaus.org> on 2012/01/23 12:20:02 UTC
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Marc Claessens created DOXIATOOLS-16:
----------------------------------------
Summary: NullPointerException when site URL is being generated
Key: DOXIATOOLS-16
URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
Project: Maven Doxia Tools
Issue Type: Bug
Environment: environment independent
Reporter: Marc Claessens
We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
i.e.
<site>
<id>project-sites</id>
<name>Our project Nexus server Site</name>
<!-- URL is built dynamically by groovy plugin -->
</site>
...
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
<![CDATA[
if(!project.distributionManagement.site.url){
String version = new String(project.version)
String path = new String(project.artifactId)+'/'+version
project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
}
]]>
</source>
</configuration>
</execution>
</executions>
</plugin>
}
This leads to a NullPointerException in DefaultSiteTool.java:
at java.io.File.<init>(File.java:222)
at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Herve Boutemy updated DOXIATOOLS-16:
------------------------------------
Description:
We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
i.e.
{code:xml}<site>
<id>project-sites</id>
<name>Our project Nexus server Site</name>
<!-- URL is built dynamically by groovy plugin -->
</site>
...
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
<![CDATA[
if(!project.distributionManagement.site.url){
String version = new String(project.version)
String path = new String(project.artifactId)+'/'+version
project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
}
]]>
</source>
</configuration>
</execution>
</executions>
</plugin>
{code}
This leads to a NullPointerException in DefaultSiteTool.java:
{noformat}at java.io.File.<init>(File.java:222)
at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451){noformat}
The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
was:
We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
i.e.
<site>
<id>project-sites</id>
<name>Our project Nexus server Site</name>
<!-- URL is built dynamically by groovy plugin -->
</site>
...
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
<![CDATA[
if(!project.distributionManagement.site.url){
String version = new String(project.version)
String path = new String(project.artifactId)+'/'+version
project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
}
]]>
</source>
</configuration>
</execution>
</executions>
</plugin>
}
This leads to a NullPointerException in DefaultSiteTool.java:
at java.io.File.<init>(File.java:222)
at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
> Assignee: Dennis Lundberg
> Fix For: doxia-integration-tools-1.5
>
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> {code:xml}<site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {code}
> This leads to a NullPointerException in DefaultSiteTool.java:
> {noformat}at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451){noformat}
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg closed DOXIATOOLS-16.
-------------------------------------
Resolution: Fixed
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
> Assignee: Dennis Lundberg
> Fix For: doxia-integration-tools-1.5
>
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg updated DOXIATOOLS-16:
--------------------------------------
Component/s: Doxia Integration Tools
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Marc Claessens (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=293101#comment-293101 ]
Marc Claessens commented on DOXIATOOLS-16:
------------------------------------------
In the meantime we have created a workaround by creating a new Site model also using the gmaven plugin:
//build default project.distributionManagement.site if doesn't exist
if(! project.distributionManagement.site){
project.distributionManagement.site = new org.apache.maven.model.Site();
project.distributionManagement.site.id = ...
project.distributionManagement.site.name = ...
}
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Environment: environment independent
> Reporter: Marc Claessens
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Marc Claessens (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marc Claessens reopened DOXIATOOLS-16:
--------------------------------------
Please also update line 1461 to check for empty site URL.
Thanks in advance.
private static String getDistMgmntSiteUrl( Model model )
{
if ( model.getDistributionManagement() != null
&& model.getDistributionManagement().getSite() != null
&& model.getDistributionManagement().getSite().getUrl() != null )
{
...
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
> Assignee: Dennis Lundberg
> Fix For: doxia-integration-tools-1.5
>
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg closed DOXIATOOLS-16.
-------------------------------------
Resolution: Fixed
Fix Version/s: doxia-integration-tools-1.5
Assignee: Dennis Lundberg
Fixed in [r1310106|http://svn.apache.org/viewvc?view=revision&revision=1310106].
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
> Assignee: Dennis Lundberg
> Fix For: doxia-integration-tools-1.5
>
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIATOOLS-16) NullPointerException when site URL is being
generated
Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIATOOLS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=309301#comment-309301 ]
Dennis Lundberg commented on DOXIATOOLS-16:
-------------------------------------------
Fixed in [r1388197|http://svn.apache.org/viewvc?view=revision&revision=1388197].
> NullPointerException when site URL is being generated
> -----------------------------------------------------
>
> Key: DOXIATOOLS-16
> URL: https://jira.codehaus.org/browse/DOXIATOOLS-16
> Project: Maven Doxia Tools
> Issue Type: Bug
> Components: Doxia Integration Tools
> Environment: environment independent
> Reporter: Marc Claessens
> Assignee: Dennis Lundberg
> Fix For: doxia-integration-tools-1.5
>
>
> We have a parent POM where the site url is generated via the Maven Groovy plugin, unless it is explicitly defined in the child POM
> i.e.
> <site>
> <id>project-sites</id>
> <name>Our project Nexus server Site</name>
> <!-- URL is built dynamically by groovy plugin -->
> </site>
> ...
> <plugin>
> <groupId>org.codehaus.groovy.maven</groupId>
> <artifactId>gmaven-plugin</artifactId>
> <executions>
> <execution>
> <phase>pre-site</phase>
> <goals>
> <goal>execute</goal>
> </goals>
> <configuration>
> <source>
> <![CDATA[
> if(!project.distributionManagement.site.url){
> String version = new String(project.version)
> String path = new String(project.artifactId)+'/'+version
> project.distributionManagement.site.url ='dav:'+project.properties['siteBaseURL'] + path
> }
> ]]>
> </source>
> </configuration>
> </execution>
> </executions>
> </plugin>
> }
> This leads to a NullPointerException in DefaultSiteTool.java:
> at java.io.File.<init>(File.java:222)
> at org.apache.maven.doxia.tools.DefaultSiteTool.urlEncode(DefaultSiteTool.java:1478)
> at org.apache.maven.doxia.tools.DefaultSiteTool.getDistMgmntSiteUrl(DefaultSiteTool.java:1451)
> The if statement in getDistMgntSiteUrl (for both methods) should test for null on project.getDistributionManagement().getSite().getUrl()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira