RE: Including sibling module attachment inside another module artifact

2010-03-05 Thread Thomas Harris

Yeah, can't split up the code; 1. A lot of the code in the two artifacts is the 
same and, 2. This code is an existing project consisting of a enormous ball of 
mud, and the client will not pay for refactoring. The circular dependencies 
alone would make any decent programmer run screaming.

I guess it's alright if we have both jars in the war subfolder; we will never 
reference the main artifact, and it makes the deployment ear bigger for no 
reason other than maven's idiosyncrasies. Eh.

Yeah, sounds like a JIRA ticket is in order. By the time it's addressed, 
though, I will probably be long done with the project, and no one will ever 
revisit. :)

Thanks for all your help, Wayne. Karma!

Tom

-Original Message-
From: Wayne Fay [mailto:wayne...@gmail.com] 
Sent: Friday, March 05, 2010 4:13 PM
To: Maven Users List
Subject: Re: Including sibling module attachment inside another module artifact

> It now takes both the main artifact AND the classified attachment. Closer, 
> but still wrong. So odd.

Except in very specific circumstances, I am not a fan of artifacts
with classifiers. Reconfigure your project so that you have 2 separate
modules and don't use classifier, and I'd assume it will work.

But that does seem odd/wrong, so file a JIRA as well.

Wayne

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



Re: Including sibling module attachment inside another module artifact

2010-03-05 Thread Wayne Fay
> It now takes both the main artifact AND the classified attachment. Closer, 
> but still wrong. So odd.

Except in very specific circumstances, I am not a fan of artifacts
with classifiers. Reconfigure your project so that you have 2 separate
modules and don't use classifier, and I'd assume it will work.

But that does seem odd/wrong, so file a JIRA as well.

Wayne

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



RE: Including sibling module attachment inside another module artifact

2010-03-05 Thread Thomas Harris
Wayne:

It now takes both the main artifact AND the classified attachment. Closer, but 
still wrong. So odd.

Tom

-Original Message-
From: Wayne Fay [mailto:wayne...@gmail.com] 
Sent: Friday, March 05, 2010 3:09 PM
To: Maven Users List
Subject: Re: Including sibling module attachment inside another module artifact

>                
>                  com.x
>                  module1
>                  ${project.version}
>                  jar
blah

Did you try this? The documentation doesn't show it, but the API [1]
has a getClassifier() which makes me think its there.

[1] 
http://maven.apache.org/plugins/maven-dependency-plugin/apidocs/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.html

Wayne

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



Re: Including sibling module attachment inside another module artifact

2010-03-05 Thread Wayne Fay
>                
>                  com.x
>                  module1
>                  ${project.version}
>                  jar
blah

Did you try this? The documentation doesn't show it, but the API [1]
has a getClassifier() which makes me think its there.

[1] 
http://maven.apache.org/plugins/maven-dependency-plugin/apidocs/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.html

Wayne

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



RE: Including sibling module attachment inside another module artifact

2010-03-05 Thread Thomas Harris
Wayne:

Thanks a lot for the headstart. I've got the first part of the solution working 
now, however I'm having trouble figuring out how to specify the derived 
attachment from module1 in the m-dependency-p:copy portion of it.

Here's a fragment from my module2's pom:

  
org.apache.maven.plugins
maven-dependency-plugin

  
copy-installed
install

  copy


  

  com.x
  module1
  ${project.version}
  jar

  
  WebRoot/XXX

  

  

Thing is, the artifact I want is the attachment, ie. it has a classifier 
associated with it. The jar file is named module1-1.0.0-classifiername.jar. As 
is, it doesn't even copy the non-classified file, so I've bungled something 
else, and, even if it did work, there's no way to specify the classifier. What 
to do?

Tom Harris

-Original Message-
From: Wayne Fay [mailto:wayne...@gmail.com] 
Sent: Thursday, March 04, 2010 12:59 PM
To: Maven Users List
Subject: Re: Including sibling module attachment inside another module artifact

> module1's output is two jar files, one the standard output, and the
> other the extra one defined with includes/excludes using the
> maven-jar-plugin and a classifier.

The extra one needs to be attached to your project with
build-helper-m-p and installed and deployed alongside the standard
output.

> What I want to do is include this attachment inside the module2
> war artifact, under that XXX folder. The WebRoot folder is defined to
> be the staging area for the war artifact.

You should use m-dependency-p:copy to put the extra one in WebRoot.

Wayne

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



Re: Including sibling module attachment inside another module artifact

2010-03-04 Thread Wayne Fay
> module1's output is two jar files, one the standard output, and the
> other the extra one defined with includes/excludes using the
> maven-jar-plugin and a classifier.

The extra one needs to be attached to your project with
build-helper-m-p and installed and deployed alongside the standard
output.

> What I want to do is include this attachment inside the module2
> war artifact, under that XXX folder. The WebRoot folder is defined to
> be the staging area for the war artifact.

You should use m-dependency-p:copy to put the extra one in WebRoot.

Wayne

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



RE: Including sibling module attachment inside another module artifact

2010-03-01 Thread Thomas Harris
Correction:
The assembly file should have actually said:
module2/WebRoot/XXX

Typing error in the email... Still need help getting this to work. Thanks.

Tom Harris

-Original Message-
From: Thomas Harris 
Sent: Monday, March 01, 2010 5:56 PM
To: users@maven.apache.org
Subject: Including sibling module attachment inside another module artifact

Maven Users:

I have been searching for examples of how to make this work, but I must be 
missing something.

We have a multimodule project, along these lines:

proj-parent
|-  modules
|- module1
 |- target
 |- module1-1.0.0-classifiername.jar
|- module2
 |- WebRoot
  |- XXX

module1's output is two jar files, one the standard output, and the other the 
extra one defined with includes/excludes using the maven-jar-plugin and a 
classifier.

What I want to do is include this attachment inside the module2 war artifact, 
under that XXX folder. The WebRoot folder is defined to be the staging area for 
the war artifact.

I have tried to use an assembly to do this, but it has no effect. The modules 
project defines this in its build plugins:

  
maven-assembly-plugin

  
src/assemble/classifiername.xml
  

  

I put the classifiername.xml under the modules project in the src/assemble 
folder, and it contains:

http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
 http://maven.apache.org/xsd/assembly-1.1.0.xsd";>
  

  
*:module1
  
  
classifiername
module2/WebRoot/lib
foo.jar
  

  


But, when I run mvn clean install, the war file does not contain the file, and 
the build output never mentions it even tried to follow the instructions, no 
errors either. How do I get this to work?

This artifact is a special jar that gets deployed to clients via the web using 
Java Web Start, and this is a port of an existing project, so I cannot change 
the internal folder layout of the war.

(Names of the artifacts and projects have been changed to protect the innocent.)

Tom Harris

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