Peter Horlock schrieb:
thanks a lot, this helped.
One more, however:
Now it creates the jar as it should, but I would like to have a different
name for it when installating it into the local / remote repo.
Under target, it creates:
myproject-mysubversion-1.1.jar
but when installing or deploying, it installs /deploys it as:
myproject-1.1.jar (just like the jar that contains all classes).
All artifacts in a repository have to follow a common naming schema so
that maven can locate them. The schema is:
artifactid-version[-classifier].packaging
This is fixed, you can't put arbitrary named jars in there.
I tried:
<plugin>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<artifactId>myproject-mysubversion</artifactId>
</configuration>
</plugin>
as well as:
<plugin>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<file>yproject-mysubversion-${version}.${packaging}</file>
</configuration>
</plugin>
Where did you get that configuration parameters from? The
install-plugin's documentation [1] doesn't mention these.
but both just installed the file as myproject-1.1.jar into my repository.
This could lead to really bad confusions... :-(
That's expected, the install-plugin doesn't know these parameters and
just ignores them.
Any ideas?
I would configure it like this in my pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>package-stripped-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>stripped</classifier>
<excludes>
<exclude>pkg1/Class1.class</exclude>
<exclude>pkg2/**</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
This configures a second execution of the jar plugin in addition to the
default execution because of the jar-packaging. This second execution
creates the stripped down jar with the given classifier and attaches it
to the build.
The install (and deploy) plugin will automatically pick up the main
artifact (created by the default jar execution) and the second one with
the clsssifier and installs/deploys them to the repository.
when you need to reference the stripped plugin in another project the
dependency would look like this:
<dependency>
<groupId>mygroup.id</groupId>
<artifactId>my-artifact</artifactId>
<version>3.14159</version>
<classifier>stripped</classifier>
</dependency>
Thanks guys,
Peter Horlock
-Tim
[1] http://maven.apache.org/plugins/maven-install-plugin/install-mojo.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]