[ 
https://issues.apache.org/jira/browse/NPANDAY-623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14030319#comment-14030319
 ] 

Greg Domjan edited comment on NPANDAY-623 at 6/13/14 6:58 AM:
--------------------------------------------------------------

I think perhaps this needs to change to a doc issue, it's not so much a bug as 
a 'maven doesn't work that way' issue that needs some reminder.


Attaching the artifact or 'set-artifact' needs to be run as a step in compile
 - and needs to run after the artifact file is present.
 - anything after compile it is not much better than being run in package.

option 1) could change set-artifact to run during compile (instead of package), 
but as part of default lifecycle it would run before other project additional 
actions also run during compile - this could make it run too early and thus 
fail on clean builds.  
'custom builds' could be done during an earlier phase like generate-sources, 
this would need to be documented.  
While the artifact should match finalName newbies might not know, could be good 
to include in that doc. (I still make the mistake often as can be seen even in 
the example I didn't use it for the target name)

option 2) use some other plugin to attach the artifact when it is built - like 
build-helper or if using some other maven scripting tools such as the example 
maven-antrun-plugin
  ensuring you have a suitable  {code:xml}<attachartifact 
file="${project.build.directory}\${project.build.finalName}.dll" 
type="dll"/>{code}

option 3) add to usage document of custom-lifecycle-maven-plugin that an 
execution should be added to support the release pluggin and compilation only 
builds.
{code:xml}
<executions>
  <execution>
    <id>CustomBuild</id>
    <phase>compile</phase>
    <goals>
      <goal>set-artifact</goal>
    </goals>
  </execution>
</executions>
{code}

Feel free to close this out, if I get a chance I'll submit a change for doc 
along the lines above.



was (Author: gdomjan):
I think perhaps this needs to change to a doc issue, it's not so much a bug as 
a 'maven doesn't work that way' issue that needs some reminder.


Attaching the artifact or 'set-artifact' needs to be run as a step in compile
 - and needs to run after the artifact file is present.
 - anything after compile it is not much better than being run in package.

option 1) could change set-artifact to run during compile (instead of package), 
but as part of default lifecycle it would run before other project additional 
actions also run during compile - this could make it run too early and thus 
fail on clean builds.  
'custom builds' could be done during an earlier phase like generate-sources, 
this would need to be documented.  
While the artifact should match finalName newbies might not know, could be good 
to include in that doc. (I still make the mistake often as can be seen even in 
the example I didn't use it for the target name)

option 2) use some other plugin to attach the artifact when it is built - like 
build-helper or if using some other maven scripting tools such as the example 
maven-antrun-plugin
  ensuring you have a suitable  ```<attachartifact 
file="${project.build.directory}\${project.build.finalName}.dll" type="dll"/>```

option 3) add to usage document of custom-lifecycle-maven-plugin that an 
execution should be added to support the release pluggin and compilation only 
builds.
<executions>
<execution>
<id>CSharpObjGen</id>
<phase>compile</phase>
<goals>
<goal>set-artifact</goal>
</goals>
</execution>
</executions>

Feel free to close this out, if I get a chance I'll submit a change for doc 
along the lines above.


> Support reactor reference to other modules at compile phase 
> ------------------------------------------------------------
>
>                 Key: NPANDAY-623
>                 URL: https://issues.apache.org/jira/browse/NPANDAY-623
>             Project: NPanday
>          Issue Type: Bug
>          Components: Maven Plugins
>    Affects Versions: 1.4-incubating, 1.5.0-incubating
>         Environment: Maven 2.2.1
>            Reporter: Greg Domjan
>         Attachments: example.zip
>
>
> When building multiple artifacts with dependencies in the reactor it appears 
> to be currently required that you build to the "install" phase.  
> This can actually be a bug - see 
> http://developer-blog.cloudbees.com/2012/12/maven-and-hack.html
> Even if not a bug, this goes against some common practices such as used in 
> the release-plugin which attempts to test the build by running all projects 
> to compile stage only.
> In comparison the maven reactor allows for dependency resolution in Java JAR 
> dependencies as soon as the compile phase is run. It does this by pointing 
> the artifact file to the local class folder.
> NPanday could take similar action and point the file to the local target file 
> as soon as compile.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to