Hello,
I've upgraded today from the 'old' plugin to the new one and I got
blocked by a classpath problem.
Basically I have two modules which both use the 'bundle' package:
spring-core (which osgifies the original spring-core maven jar).
and
spring-osgi-io which depends on the osgi bundle of the bundle above.
(see the attached poms)
If ran individually, each module works fine. If I ran them together (as
part of a bigger project), the second doesn't compile and throws weird
errors.
I've ran maven -X and it seems that the problem is caused by the
classpath which doesn't get updated:
[DEBUG] Source directories: [D:\work\i21\spring-osgi-sf\io\src\main\java]
[DEBUG] Classpath: [D:\work\i21\spring-osgi-sf\io\target\classes
C:\Documents and
Settings\User\.m2\repository\org\slf4j\slf4j-api\1.3.1\slf4j-api-1.3.1.jar
C:\Documents and
Settings\User\.m2\repository\org\slf4j\jcl104-over-slf4j\1.3.1\jcl104-over-slf4j-1.3.1.jar
C:\Documents and
Settings\User\.m2\repository\org\osgi\org.osgi.core\4.0\org.osgi.core-4.0.jar
**********
D:\work\i21\spring-osgi-sf\spring-modules\spring-core\target\classes
**********
C:\Documents and
Settings\User\.m2\repository\org\slf4j\slf4j-log4j12\1.3.1\slf4j-log4j12-1.3.1.jar
C:\Documents and
Settings\User\.m2\repository\org\eclipse\osgi\org.eclipse.osgi\3.2.2\org.eclipse.osgi-3.2.2.jar
C:\Documents and
Settings\User\.m2\repository\log4j\log4j\1.2.13\log4j-1.2.13.jar]
[DEBUG] Output directory: D:\work\i21\spring-osgi-sf\io\target\classes
Basically, it seems that the spring-core dependency is replaced with a
target/classes folder which is empty.
When ran by itself, the classpath is the one expected:
C:\Documents and
Settings\User\.m2\repository\org\springframework\osgi\spring-core\2.1-m2-SNAPSHOT\spring-core-2.1-m2-SNAPSHOT.jar
>From what I can see, it seems that the bundle plugin keeps the old
classpath between runs.
Any ideas or workarounds are welcomed. This is a blocking issue before a
release ...
P.S. I'm using the latest 0.9.0 SNAPSHOT.
Thanks,
--
Costin
<?xml version="1.0"?>
<project>
<parent>
<artifactId>spring-osgi</artifactId>
<groupId>org.springframework.osgi</groupId>
<version>1.0-m2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-io</artifactId>
<packaging>bundle</packaging>
<name>Spring OSGi IO</name>
<url>http://www.springframework.org/osgi</url>
<description>
Spring/OSGi IO abstract classes. Provides Resource, ResourceLoader and ResourcePatternResolver
for OSGi environments.
</description>
<properties>
<spring.osgi.export.pkg>org.springframework.osgi.io</spring.osgi.export.pkg>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-osgi-mock</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.maven.artifact.version}</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</project>
<?xml version="1.0"?>
<project>
<parent>
<artifactId>spring-modules</artifactId>
<groupId>org.springframework.osgi</groupId>
<version>2.1-m2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.osgi</groupId>
<artifactId>spring-core</artifactId>
<packaging>bundle</packaging>
<name>Spring core module (OSGi version)</name>
<version>${project.parent.version}</version>
<url>http://www.springframework.org</url>
<properties>
<!-- optional imports-->
<spring.osgi.import.pkg>
org.apache.commons.collections*;resolution:=optional,
org.apache.log4j*;resolution:=optional,
org.objectweb.asm*;resolution:=optional,
javax.xml.transform;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.xml.sax;resolution:=optional,
*
</spring.osgi.import.pkg>
</properties>
</project>