[forge-issues] [JBoss JIRA] (FORGE-430) Fix MavenCoreFacetImpl getPom()

Lincoln Baxter III (JIRA) jira-events at lists.jboss.org
Mon Jan 16 14:22:18 EST 2012


    [ https://issues.jboss.org/browse/FORGE-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659639#comment-12659639 ] 

Lincoln Baxter III commented on FORGE-430:
------------------------------------------

To address your statement about `source-plugin` not working, though, if the dependency resolution is not working, there is probably a different issue going on and should be reported in its own issue. I know that's kind of a pain, but this issue sounds like it was more for MavenCoreFacetImpl, not for `source-plugin`. 

I hope that makes sense, I don't mean to be .. mean, I just need to make sure that issues stay clear and are actually about the issues they are reported for :) So if `source-plugin` is giving you trouble, could you please file an issue for that specifically?

Thanks!
~Lincoln
                
> Fix MavenCoreFacetImpl getPom()
> -------------------------------
>
>                 Key: FORGE-430
>                 URL: https://issues.jboss.org/browse/FORGE-430
>             Project: Forge
>          Issue Type: Bug
>    Affects Versions: 1.0.0.Beta5
>         Environment: Windows 7, Desktop PC
>            Reporter: Max Schwaab
>            Assignee: Lincoln Baxter III
>            Priority: Minor
>              Labels: maven
>             Fix For: 1.0.0.CR1, Future
>
>
> Please have a look at org.jboss.forge.maven.facets.MavenCoreFacetImpl in the forge-project-model-maven project.
> The getPom() method reads the pom directly from the file resource. This results in a warning when using maven properties for dependency versions, e.g. when you try to install a plugin via the source-plugin command (***WARNING*** Could not resolve dependency [org.some:dependency:jar::${some.version}])
> The plugin works after installation and I don't know if its important to resolve this issue, but in the code is a "//FIXME"-remark too. The same may be relevant for setPOM(final Model pom) too.
> {code:title=MavenCoreFacetImpl getPom()}
>    @Override
>    public Model getPOM()
>    {
>       try
>       {
>          Model result = new Model();
>          // FIXME this should/can-not use the Maven Native file writer if we are going to abstract file APIs
>          MavenXpp3Reader reader = new MavenXpp3Reader();
>          FileInputStream stream = new FileInputStream(getPOMFile().getUnderlyingResourceObject());
>          if (stream.available() > 0)
>          {
>             result = reader.read(stream);
>          }
>          stream.close();
>          result.setPomFile(getPOMFile().getUnderlyingResourceObject());
>          return result;
>       }
>       catch (IOException e)
>       {
>          throw new ProjectModelException("Could not open POM file: " + getPOMFile(), e);
>       }
>       catch (XmlPullParserException e)
>       {
>          throw new ProjectModelException("Could not parse POM file: " + getPOMFile(), e);
>       }
>    }
> {code}
> Example for my plugins pom.xml
> {code}
> <project
> 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
> 	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> 	<properties>
> 		<some.version>1.0</some.version>
> 	</properties>
> 	<dependencies>
> 		<dependency>
> 			<groupId>org.some</groupId>
> 			<artifactId>dependency</artifactId>
> 			<version>${some.version}</version>
> 		</dependency>
> 	</dependencies>
> 	<repositories>
> 		<repository>
> 			<id>repository.some</id>
> 			<name>Some Repository for Maven</name>
> 			<url>http://some.repo.url</url>
> 		</repository>
> 	</repositories>
> </project>
> {code}
> Best regards
> Max

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-issues mailing list