Hi Brian,

sorry that I forgot the dependency. It is declared in the variations-parent
POM:

<dependency>
  <groupId>de.smartics.timesheet</groupId>
  <artifactId>timesheet-ejb-core</artifactId>
  <version>${depVersion.timesheet-ejb-core}</version>
  <classifier>tests</classifier>
  <scope>test</scope>
</dependency>

<depVersion.timesheet-ejb-core>0.1.0-SNAPSHOT</depVersion.timesheet-ejb-core>


since I require the non-classifier form, too, this dependency is also
included (but should do no harm):
<!-- Every variation depends on the core artifact. -->
<dependency>
  <groupId>de.smartics.timesheet</groupId>
  <artifactId>timesheet-ejb-core</artifactId>
  <version>${depVersion.timesheet-ejb-core}</version>
  <type>ejb</type>
  <!-- The persistency.xml file is required to be placed in the jar's
         META-INF where the entity classes are packed. Therefore we
         explode the core jar and repack it. So the dependency here is
         'provided' to not make this transitive dependent... -->
         <scope>provided</scope>
</dependency>

I used this environment:

PROMPT>mvn -version
Maven version: 2.0.8
Java version: 1.6.0_04
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"


I did not find 2.0.9-RC8, hope this version from svn helps:

PROMPT>mvn -version
Maven version: 2.0.9-RC9-SNAPSHOT
Java version: 1.6.0_04
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

The jar-plugin is the recent version (declared in the root project's POM):
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>2.2</version>
</plugin>


To reproduced the problem with this new environment I did the following:
1. Removed all timesheet artifacts from the local repository.
2. Commented out the build-helper-plugin in the core-module.
3. Run: maven -o clean package (in the project's root)

[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   timesheet EJB 3 infrastructure POM                             <--
The parent of core and variations
[INFO]   timesheet EJB 3 core infrastructure                             <--
The core module
[INFO]   timesheet EJB 3 infrastructure variations POM            <-- The
variations parent module
[INFO]   timesheet EJB 3 infrastructure for JBoss, Hibernate and MySql <-- A
variation module
...

The error:

[INFO] [jar:test-jar {execution: default}]
[INFO] Building jar:
F:\Projekte\workspaces\timesheet\timesheet-1\timesheet-ejb\
timesheet-ejb-core\target\timesheet-ejb-core-0.1.0-SNAPSHOT-tests.jar
[INFO]
------------------------------------------------------------------------
[INFO] Building timesheet EJB 3 infrastructure variations POM
[INFO]    task-segment: [clean, package]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
F:\Projekte\workspaces\timesheet\timesheet-1\timesheet
-ejb\timesheet-ejb-variations\target
[INFO] [cobertura:clean {execution: default}]
[INFO] [site:attach-descriptor]
[INFO]
------------------------------------------------------------------------
[INFO] Building timesheet EJB 3 infrastructure for JBoss, Hibernate and
MySql
[INFO]    task-segment: [clean, package]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
F:\Projekte\workspaces\timesheet\timesheet-1\timesheet
-ejb\timesheet-ejb-variations\timesheet-ejb-jboss-hibernate-mysql\target
[INFO] [cobertura:clean {execution: default}]
[INFO] [resources:resources]
[INFO] Using encoding: 'UTF-8' to copy filtered resources.
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) de.smartics.timesheet:timesheet-ejb-core:jar:tests:0.1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=de.smartics.timesheet
-DartifactId=time
sheet-ejb-core -Dversion=0.1.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar
-Dfil
e=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
there:

      mvn deploy:deploy-file -DgroupId=de.smartics.timesheet
-DartifactId=timesh
eet-ejb-core -Dversion=0.1.0-SNAPSHOT -Dclassifier=tests -Dpackaging=jar
-Dfile=
/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1)
de.smartics.timesheet:timesheet-ejb-jboss-hibernate-mysql:ejb:0.1.0-S
NAPSHOT
        2) de.smartics.timesheet:timesheet-ejb-core:jar:tests:0.1.0-SNAPSHOT

----------
1 required artifact is missing.

for artifact:
 
de.smartics.timesheet:timesheet-ejb-jboss-hibernate-mysql:ejb:0.1.0-SNAPSHOT

from the specified remote repositories:
  apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository),
  maven.org (http://repo1.maven.org/eclipse/),
  codehaus (http://repository.codehaus.org/),
  java.net (http://download.java.net/maven/1),
  ...
  ibiblio (http://www.ibiblio.org/maven2),
  central (http://repo1.maven.org/maven2)

NOTE: Maven is executing in offline mode. Any artifacts not already in your
local repository will be inaccessible.



Now I use the buildhelper plugin, run "maven -o clean package" again.

Declared in the root project's POM:
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>build-helper-maven-plugin</artifactId>
  <version>1.0</version>
</plugin>

I get a positive result:

[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] timesheet EJB 3 infrastructure POM .................... SUCCESS
[10.175s]
[INFO] timesheet EJB 3 core infrastructure ................... SUCCESS
[28.020s]
[INFO] timesheet EJB 3 infrastructure variations POM ......... SUCCESS
[0.121s]
[INFO] timesheet EJB 3 infrastructure for JBoss, Hibernate and MySql 
SUCCESS [36.512s]
[INFO] timesheet JSF web application ......................... SUCCESS
[3.986s]
[INFO] timesheet app POM ..................................... SUCCESS
[0.871s]
[INFO] timesheet application (JSF, JBoss, MySQL) ............. SUCCESS
[1.893s]
[INFO] timesheet EJB 3 infrastructure for JBoss, Hibernate and HSql  SUCCESS
[25.887s]
[INFO] timesheet root POM .................................... SUCCESS
[0.451s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 57 seconds
[INFO] Finished at: Sat Apr 05 23:19:22 CEST 2008
[INFO] Final Memory: 34M/61M
[INFO]
------------------------------------------------------------------------

Conclusion: With neither version does my build succeed without the
buildhelper plugin.
With the buildhelper everything runs fine!

Hope this helps?

Regards,
  Robert


Brian E Fox wrote:
> 
> What you have looks fairly correct. I don't see your dependency section
> but I'm assuming you declared a dependency with classifier tests? (like
> shown here:
> http://maven.apache.org/guides/mini/guide-attached-tests.html). If so,
> then you may be seeing these issues: (which may actually be a core
> issue, not a problem with jar itself). I can't really explain why the
> build helper plugin changes things.
> http://jira.codehaus.org/browse/MJAR-68
> http://jira.codehaus.org/browse/MNG-2045
> 
> I don't see in your posts which maven version you're using. MNG-2045 was
> supposedly fixed in 2.0.8, but there also seem to be comments to the
> contrary. Can you give it a try with 2.0.8 (if you haven't) and with
> 2.0.9-RC8?
> 
> --Brian
> 

-- 
View this message in context: 
http://www.nabble.com/jar-does-not-attach-to-reactor--tp16491295s177p16518289.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to